| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | public function testDIinApp() |
||
| 25 | { |
||
| 26 | // arrange |
||
| 27 | $container = new Container(); |
||
| 28 | |||
| 29 | $container['filesystem_adapter'] = function($c) { return new MemoryAdapter(); }; |
||
|
|
|||
| 30 | $container['filesystem'] = function($c) { return new Filesystem($c['filesystem_adapter']); }; |
||
| 31 | |||
| 32 | $container['module_repository'] = function($c) { |
||
| 33 | $storage = new JSONModuleStorage($c['filesystem'], 'modules.json'); |
||
| 34 | $mapper = new ModuleMapper(); |
||
| 35 | return new ModuleRepository($storage, $mapper); |
||
| 36 | }; |
||
| 37 | $app = new App($container); |
||
| 38 | |||
| 39 | // act |
||
| 40 | $filesystem = $app->getContainer()->get('filesystem'); |
||
| 41 | $hasFile = $filesystem->has('notExistingFile.txt'); |
||
| 42 | |||
| 43 | // assert |
||
| 44 | $this->assertFalse($hasFile); |
||
| 45 | } |
||
| 46 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.