mirror of
https://github.com/Karaka-Management/oms-Draw.git
synced 2026-01-11 14:28:40 +00:00
more tests and make classes final
This commit is contained in:
parent
315d7afe45
commit
63c100a785
|
|
@ -33,7 +33,7 @@ class DrawImage implements \JsonSerializable, ArrayableInterface
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private int $id = 0;
|
||||
protected int $id = 0;
|
||||
|
||||
/**
|
||||
* Media object.
|
||||
|
|
|
|||
|
|
@ -24,4 +24,15 @@ namespace Modules\Draw\Models;
|
|||
*/
|
||||
final class NullDrawImage extends DrawImage
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
42
tests/Models/NullDrawImageTest.php
Normal file
42
tests/Models/NullDrawImageTest.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\Draw\tests\Models;
|
||||
|
||||
use Modules\Draw\Models\NullDrawImage;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NullDrawImageTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\Draw\Models\NullDrawImage
|
||||
* @group framework
|
||||
*/
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Draw\Models\DrawImage', new NullDrawImage());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\Draw\Models\NullDrawImage
|
||||
* @group framework
|
||||
*/
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullDrawImage(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user