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

WarehouseTest::testTransformToTreeConstructor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 1 Features 3
Metric Value
cc 1
eloc 7
c 4
b 1
f 3
nc 1
nop 0
dl 0
loc 14
rs 10
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
}