This commit is contained in:
johny
2026-01-12 12:37:16 +01:00
commit 516e51e0e9
76 changed files with 11962 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
<?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);
}
}