Passed
Branch master (ba7819)
by David
01:30
created

WarehouseMatrixTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSampleData() 0 7 1
A testWarehouseConstructor() 0 5 1
1
<?php
2
3
use GGGGino\WarehousePath\Warehouse;
4
use PHPUnit\Framework\TestCase;
5
6
final class WarehouseMatrixTest extends TestCase
7
{
8
    /**
9
     * Super simple warehouse representation
10
     *
11
     * @return array
12
     */
13
    public static function getSampleData()
14
    {
15
        return array(
16
            array(array('weight' => 2), array('weight' => 1), array('weight' => 100), array('weight' => 1), array('weight' => 2), array('weight' => 1)),
17
            array(array('weight' => 2), array('weight' => 1), array('weight' => 100), array('weight' => 1), array('weight' => 2), array('weight' => 1)),
18
            array(array('weight' => 2), array('weight' => 1), array('weight' => 100), array('weight' => 1), array('weight' => 2), array('weight' => 1)),
19
            array(array('weight' => 2), array('weight' => 2), array('weight' =>   2), array('weight' => 2), array('weight' => 2), array('weight' => 1))
20
        );
21
    }
22
23
    public function testWarehouseConstructor(): void
24
    {
25
        $testMatrix = Warehouse::createFromMatrix(self::getSampleData());
26
27
        $this->assertInstanceOf(Warehouse::class, $testMatrix);
28
    }
29
}