| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testOverflow() |
||
| 16 | { |
||
| 17 | $collection = new CommandsCollection(); |
||
| 18 | $collection->setMaxHops(3); |
||
| 19 | |||
| 20 | self::assertEquals(3, $collection->getMaxHops()); |
||
| 21 | self::assertEquals(0, $collection->getHops()); |
||
| 22 | self::assertFalse($collection->overflow()); |
||
| 23 | |||
| 24 | $command = new Command(); |
||
| 25 | $collection[] = $command; |
||
| 26 | $collection[] = $command; |
||
| 27 | self::assertEquals(2, $collection->getHops()); |
||
| 28 | self::assertFalse($collection->overflow()); |
||
| 29 | |||
| 30 | $collection[] = $command; |
||
| 31 | self::assertEquals(3, $collection->getHops()); |
||
| 32 | self::assertFalse($collection->overflow()); |
||
| 33 | |||
| 34 | self::expectException(\Exception::class); |
||
|
|
|||
| 35 | $collection[] = $command; |
||
| 36 | self::assertTrue($collection->overflow()); |
||
| 37 | } |
||
| 39 |