Browse Source

Tests for new exception features

rpm
J. King 3 years ago
parent
commit
37fd2ad4e9
  1. 2
      lib/AbstractException.php
  2. 10
      tests/cases/Exception/TestException.php

2
lib/AbstractException.php

@ -132,6 +132,6 @@ abstract class AbstractException extends \Exception {
}
public function getParams(): array {
return $this->aparams;
return $this->params;
}
}

10
tests/cases/Exception/TestException.php

@ -78,4 +78,14 @@ class TestException extends \JKingWeb\Arsse\Test\AbstractTest {
$this->expectException('JKingWeb\Arsse\ExceptionFatal');
throw new \JKingWeb\Arsse\ExceptionFatal("");
}
public function testGetExceptionSymbol(): void {
$e = new LangException("stringMissing", ['msgID' => "OOK"]);
$this->assertSame("stringMissing", $e->getSymbol());
}
public function testGetExceptionParams(): void {
$e = new LangException("stringMissing", ['msgID' => "OOK"]);
$this->assertSame(['msgID' => "OOK"], $e->getParams());
}
}

Loading…
Cancel
Save