mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-03 11:38:40 +00:00
more tests and make classes final
This commit is contained in:
parent
5581d062f8
commit
5611409387
|
|
@ -35,7 +35,7 @@ class InterfaceManager
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private int $id = 0;
|
||||
protected int $id = 0;
|
||||
|
||||
/**
|
||||
* File path.
|
||||
|
|
|
|||
|
|
@ -24,4 +24,16 @@ namespace Modules\Exchange\Models;
|
|||
*/
|
||||
final class NullExchangeLog extends ExchangeLog
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,16 @@ namespace Modules\Exchange\Models;
|
|||
*/
|
||||
final class NullInterfaceManager extends InterfaceManager
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
42
tests/Models/NullExchangeLogTest.php
Normal file
42
tests/Models/NullExchangeLogTest.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 8.0
|
||||
*
|
||||
* @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\Exchange\tests\Models;
|
||||
|
||||
use Modules\Exchange\Models\NullExchangeLog;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NullExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\Exchange\Models\NullExchangeLog
|
||||
* @group framework
|
||||
*/
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Exchange\Models\ExchangeLog', new NullExchangeLog());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\Exchange\Models\NullExchangeLog
|
||||
* @group framework
|
||||
*/
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullExchangeLog(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
}
|
||||
}
|
||||
42
tests/Models/NullInterfaceManagerTest.php
Normal file
42
tests/Models/NullInterfaceManagerTest.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 8.0
|
||||
*
|
||||
* @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\Exchange\tests\Models;
|
||||
|
||||
use Modules\Exchange\Models\NullInterfaceManager;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NullInterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\Exchange\Models\NullInterfaceManager
|
||||
* @group framework
|
||||
*/
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Exchange\Models\InterfaceManager', new NullInterfaceManager());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\Exchange\Models\NullInterfaceManager
|
||||
* @group framework
|
||||
*/
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullInterfaceManager(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user