Test Setup Failed
Branch master (ba7819)
by David
01:48
created

WarehouseTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 4
Bugs 1 Features 3
Metric Value
eloc 8
c 4
b 1
f 3
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTransformToTreeConstructor() 0 14 1
1
<?php
2
3
use GGGGino\WarehousePath\Entity\Place;
4
use GGGGino\WarehousePath\Warehouse;
5
use PHPUnit\Framework\TestCase;
6
7
final class WarehouseTest extends TestCase
8
{
9
    public function testTransformToTreeConstructor(): void
10
    {
11
        $testMatrix = Warehouse::createFromJson(getcwd() . "/resources/simpleWarehouse.json");
12
13
        $calculatedArray = $testMatrix->getPlaces();
14
15
        /** @var Place $nodeStart */
16
        $nodeStart = $calculatedArray[4];
17
        /** @var Place $nodeEnd */
18
        $nodeEnd = $calculatedArray[20];
19
20
        $this->assertEquals('04', $nodeStart->getName());
21
        $this->assertEquals('26', $nodeEnd->getName());
22
        $testMatrix->getPath($nodeStart, $nodeEnd);
23
    }
24
}