init
This commit is contained in:
61
tests/Unit/FailureReportTest.php
Normal file
61
tests/Unit/FailureReportTest.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user