Total Complexity | 15 |
Total Lines | 268 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
12 | /** |
||
13 | * RouteCollectionTest |
||
14 | */ |
||
15 | class RouteCollectionTest extends TestCase |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @return void |
||
20 | */ |
||
21 | public function testConstructor() : void |
||
22 | { |
||
23 | $collection = new RouteCollection(); |
||
24 | |||
25 | $this->assertInstanceOf(RouteCollectionInterface::class, $collection); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @return void |
||
30 | */ |
||
31 | public function testConstructorWithRoutes() : void |
||
32 | { |
||
33 | $routes = [ |
||
34 | new Fixture\TestRoute(), |
||
35 | new Fixture\TestRoute(), |
||
36 | new Fixture\TestRoute(), |
||
37 | ]; |
||
38 | |||
39 | $collection = new RouteCollection(...$routes); |
||
40 | |||
41 | $this->assertSame($routes, $collection->all()); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return void |
||
46 | */ |
||
47 | public function testAdd() : void |
||
48 | { |
||
49 | $routes = [ |
||
50 | new Fixture\TestRoute(), |
||
51 | new Fixture\TestRoute(), |
||
52 | new Fixture\TestRoute(), |
||
53 | ]; |
||
54 | |||
55 | $collection = new RouteCollection(); |
||
56 | |||
57 | $collection->add(...$routes); |
||
58 | |||
59 | $this->assertSame($routes, $collection->all()); |
||
60 | } |
||
61 | } |
||
62 |