Files
gorilla/tests/Unit/FailureReportTest.php
2026-01-12 12:37:16 +01:00

62 lines
1.8 KiB
PHP

<?php
namespace Tests\Unit;
use App\Service\Entities\FailureReport;
use App\Service\Entities\InputEntity;
use PHPUnit\Framework\TestCase;
class FailureReportTest extends TestCase
{
public function testPriorityIsKrytyczny() {
$inputEntity = new InputEntity([
'number' => 1,
'description' => 'Test Bardzo pilne zgłoszenie',
]);
$inspection = new FailureReport($inputEntity);
$this->assertEquals('krytyczny', $inspection->priority->value);
}
public function testPriorityIsWysoki() {
$inputEntity = new InputEntity([
'number' => 1,
'description' => 'Test pilne zgłoszenie',
]);
$inspection = new FailureReport($inputEntity);
$this->assertEquals('wysoki', $inspection->priority->value);
}
public function testPriorityIsNormalny() {
$inputEntity = new InputEntity([
'number' => 1,
'description' => 'Test zwykłego zgłoszenia',
]);
$inspection = new FailureReport($inputEntity);
$this->assertEquals('normalny', $inspection->priority->value);
}
public function testStatusIsTermin()
{
$inputEntity = new InputEntity([
'number' => 1,
'description' => 'Test',
'dueDate' => '2020-01-01',
]);
$inspection = new FailureReport($inputEntity);
$this->assertEquals('termin', $inspection->status->value);
}
public function testStatusIsNowy()
{
$inputEntity = new InputEntity([
'number' => 1,
'description' => 'Test',
'dueDate' => '',
]);
$inspection = new FailureReport($inputEntity);
$this->assertEquals('nowy', $inspection->status->value);
}
}