From 37fd2ad4e915e35d946fa2a4296cf350470ee006 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 7 Feb 2021 09:07:53 -0500 Subject: [PATCH] Tests for new exception features --- lib/AbstractException.php | 2 +- tests/cases/Exception/TestException.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/AbstractException.php b/lib/AbstractException.php index 922b9cd..d2cb0d5 100644 --- a/lib/AbstractException.php +++ b/lib/AbstractException.php @@ -132,6 +132,6 @@ abstract class AbstractException extends \Exception { } public function getParams(): array { - return $this->aparams; + return $this->params; } } diff --git a/tests/cases/Exception/TestException.php b/tests/cases/Exception/TestException.php index 66a1f3a..563a4f5 100644 --- a/tests/cases/Exception/TestException.php +++ b/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()); + } }