mirror of
https://github.com/Karaka-Management/oms-Support.git
synced 2026-01-10 16:48:41 +00:00
64 lines
1.2 KiB
PHP
Executable File
64 lines
1.2 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\Support\tests\Models;
|
|
|
|
use Modules\Support\Models\TicketElement;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class TicketElementTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private TicketElement $element;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->element = new TicketElement();
|
|
}
|
|
|
|
/**
|
|
* @covers \Modules\Support\Models\TicketElement
|
|
* @group module
|
|
*/
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->element->id);
|
|
self::assertEquals(0, $this->element->ticket);
|
|
}
|
|
|
|
/**
|
|
* @covers \Modules\Support\Models\TicketElement
|
|
* @group module
|
|
*/
|
|
public function testSerialize() : void
|
|
{
|
|
$this->element->ticket = 2;
|
|
|
|
$serialized = $this->element->jsonSerialize();
|
|
unset($serialized['taskElement']);
|
|
|
|
self::assertEquals(
|
|
[
|
|
'id' => 0,
|
|
'ticket' => 2,
|
|
],
|
|
$serialized
|
|
);
|
|
}
|
|
}
|