mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-16 16:38:41 +00:00
add tests
This commit is contained in:
parent
2577b793d4
commit
4cf7b05e65
|
|
@ -484,14 +484,6 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function __toString()
|
|
||||||
{
|
|
||||||
return (string) \json_encode($this->toArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ class ControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||||
$this->app->orgId = 1;
|
$this->app->orgId = 1;
|
||||||
$this->app->appName = 'Backend';
|
|
||||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||||
$this->app->appSettings = new CoreSettings($this->app->dbPool->get());
|
$this->app->appSettings = new CoreSettings($this->app->dbPool->get());
|
||||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules');
|
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules');
|
||||||
|
|
|
||||||
42
tests/Models/NullNewsArticleTest.php
Normal file
42
tests/Models/NullNewsArticleTest.php
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.4
|
||||||
|
*
|
||||||
|
* @package tests
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\News\tests\Models;
|
||||||
|
|
||||||
|
use Modules\News\Models\NullNewsArticle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
final class NullNewsArticleTest extends \PHPUnit\Framework\TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @covers Modules\News\Models\NullNewsArticle
|
||||||
|
* @group module
|
||||||
|
*/
|
||||||
|
public function testNull() : void
|
||||||
|
{
|
||||||
|
self::assertInstanceOf('\Modules\News\Models\NewsArticle', new NullNewsArticle());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Modules\News\Models\NullNewsArticle
|
||||||
|
* @group module
|
||||||
|
*/
|
||||||
|
public function testId() : void
|
||||||
|
{
|
||||||
|
$null = new NullNewsArticle(2);
|
||||||
|
self::assertEquals(2, $null->getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user