mirror of
https://github.com/Karaka-Management/oms-Draw.git
synced 2026-01-11 14:28:40 +00:00
70 lines
1.3 KiB
PHP
Executable File
70 lines
1.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.1
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Draw\tests\Models;
|
|
|
|
use Modules\Draw\Models\DrawImage;
|
|
use Modules\Media\Models\Media;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class DrawImageTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private DrawImage $img;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->img = new DrawImage();
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Draw\Models\DrawImage
|
|
* @group module
|
|
*/
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->img->id);
|
|
self::assertNull($this->img->media);
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Draw\Models\DrawImage
|
|
* @group module
|
|
*/
|
|
public function testFromMedia() : void
|
|
{
|
|
$img = DrawImage::fromMedia($temp = new Media());
|
|
self::assertEquals($temp, $img->media);
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Draw\Models\DrawImage
|
|
* @group module
|
|
*/
|
|
public function testSerialize() : void
|
|
{
|
|
self::assertEquals(
|
|
[
|
|
'id' => 0,
|
|
'media' => null,
|
|
],
|
|
$this->img->jsonSerialize()
|
|
);
|
|
}
|
|
}
|