From 4cf7b05e656a1848bb702dcbb05a8b43811c364e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 10 Oct 2020 21:28:37 +0200 Subject: [PATCH] add tests --- Models/NewsArticle.php | 8 ----- tests/Controller/ApiControllerTest.php | 1 - tests/Models/NullNewsArticleTest.php | 42 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 tests/Models/NullNewsArticleTest.php diff --git a/Models/NewsArticle.php b/Models/NewsArticle.php index cd21f20..e663a15 100755 --- a/Models/NewsArticle.php +++ b/Models/NewsArticle.php @@ -484,14 +484,6 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface ]; } - /** - * {@inheritdoc} - */ - public function __toString() - { - return (string) \json_encode($this->toArray()); - } - /** * {@inheritdoc} */ diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 162084f..58f7b76 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -47,7 +47,6 @@ class ControllerTest extends \PHPUnit\Framework\TestCase $this->app->dbPool = $GLOBALS['dbpool']; $this->app->orgId = 1; - $this->app->appName = 'Backend'; $this->app->accountManager = new AccountManager($GLOBALS['session']); $this->app->appSettings = new CoreSettings($this->app->dbPool->get()); $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules'); diff --git a/tests/Models/NullNewsArticleTest.php b/tests/Models/NullNewsArticleTest.php new file mode 100644 index 0000000..139c657 --- /dev/null +++ b/tests/Models/NullNewsArticleTest.php @@ -0,0 +1,42 @@ +getId()); + } +}