| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testTree(): void |
||
| 14 | { |
||
| 15 | $a = new Category(); |
||
| 16 | $b = new Category(); |
||
| 17 | $c = new Category(); |
||
| 18 | $d = new Category(); |
||
| 19 | |||
| 20 | $b->addParent($a); |
||
| 21 | $c->addParent($a); |
||
| 22 | |||
| 23 | self::assertCount(2, $a->getChildren()); |
||
| 24 | |||
| 25 | $d->addParent($b); |
||
| 26 | $d->addParent($c); |
||
| 27 | |||
| 28 | self::assertCount(2, $d->getParents()); |
||
| 29 | self::assertCount(1, $b->getChildren()); |
||
| 30 | self::assertCount(1, $c->getChildren()); |
||
| 31 | } |
||
| 52 |