oms-Support/tests/Models/TicketTest.php
Dennis Eichhorn c4179db837
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
fix version and bugs
2024-05-21 00:09:18 +02:00

59 lines
1.3 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Support\tests\Models;
use Modules\Support\Models\Ticket;
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\Ticket::class)]
final class TicketTest extends \PHPUnit\Framework\TestCase
{
private Ticket $ticket;
/**
* {@inheritdoc}
*/
protected function setUp() : void
{
$this->ticket = new Ticket();
}
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testDefault() : void
{
self::assertEquals(0, $this->ticket->id);
self::assertNull($this->ticket->task->for);
self::assertInstanceOf('\Modules\Tasks\Models\Task', $this->ticket->task);
self::assertInstanceOf('\Modules\Support\Models\SupportApp', $this->ticket->app);
}
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testSerialize() : void
{
$serialized = $this->ticket->jsonSerialize();
unset($serialized['task']);
unset($serialized['app']);
self::assertEquals(
[
'id' => 0,
],
$serialized
);
}
}