mirror of
https://github.com/Karaka-Management/oms-Support.git
synced 2026-01-11 17:18:40 +00:00
64 lines
1.4 KiB
PHP
Executable File
64 lines
1.4 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Karaka
|
|
*
|
|
* PHP Version 8.1
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://karaka.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Support\tests\Models;
|
|
|
|
use Modules\Support\Models\TicketAttribute;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class TicketAttributeTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private TicketAttribute $attribute;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->attribute = new TicketAttribute();
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Support\Models\TicketAttribute
|
|
* @group module
|
|
*/
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->attribute->getId());
|
|
self::assertInstanceOf('\Modules\Support\Models\TicketAttributeType', $this->attribute->type);
|
|
self::assertInstanceOf('\Modules\Support\Models\TicketAttributeValue', $this->attribute->value);
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Support\Models\TicketAttribute
|
|
* @group module
|
|
*/
|
|
public function testSerialize() : void
|
|
{
|
|
$serialized = $this->attribute->jsonSerialize();
|
|
|
|
self::assertEquals(
|
|
[
|
|
'id',
|
|
'ticket',
|
|
'type',
|
|
'value',
|
|
],
|
|
\array_keys($serialized)
|
|
);
|
|
}
|
|
}
|