| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | public function testRelatedMethods() |
||
|
|
|||
| 10 | { |
||
| 11 | $this->expectException(Exception::class); |
||
| 12 | $GLOBALS['argv'] = [ |
||
| 13 | 'diffFilter', |
||
| 14 | '--phpstan', |
||
| 15 | '--autoload=' . __DIR__ . 'fixtures/phpstanTypeError.php', |
||
| 16 | __DIR__ . '/fixtures/change.txt', |
||
| 17 | __DIR__ . '/fixtures/phpstanTypeError.txt' |
||
| 18 | ]; |
||
| 19 | |||
| 20 | require(__DIR__ . "/../src/Runners/generic.php"); |
||
| 21 | } |
||
| 22 | } |
||
| 23 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: