| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public function test() |
||
| 16 | { |
||
| 17 | $this->assertCount(0, $this->subscriptions); |
||
| 18 | $this->assertCount(0, $this->registrations); |
||
| 19 | $result = $this->dispatch('module.bootstrap'); |
||
|
|
|||
| 20 | |||
| 21 | // web.register was called |
||
| 22 | $this->assertCount(1, $this->registrations); |
||
| 23 | |||
| 24 | // event.subscribe was called |
||
| 25 | $this->assertCount(1, $this->subscriptions); |
||
| 26 | $this->assertSame($this->subscriptions[0]->event, 'person.created'); |
||
| 27 | $this->assertSame($this->subscriptions[0]->service, 'test'); |
||
| 28 | |||
| 29 | // cache exists |
||
| 30 | $cache = getcwd().'/.cache'; |
||
| 31 | $this->assertTrue(is_dir($cache)); |
||
| 32 | rmdir($cache); |
||
| 33 | } |
||
| 34 | |||
| 48 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.