logfileco /
logfile-php
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Tests; |
||
| 4 | |||
| 5 | use PHPUnit\Framework\TestCase; |
||
| 6 | |||
| 7 | class ContextTest extends TestCase |
||
| 8 | { |
||
| 9 | protected $file; |
||
| 10 | |||
| 11 | public function setup() |
||
| 12 | { |
||
| 13 | $this->file = tempnam(sys_get_temp_dir(), 'PHPUnitContext'); |
||
| 14 | $handle = fopen($this->file, 'w+'); |
||
| 15 | if (false === $handle) { |
||
| 16 | throw new \ErrorException('Failed to open file: '.$this->file); |
||
| 17 | } |
||
| 18 | foreach (range(1, 40) as $line) { |
||
| 19 | fwrite($handle, 'Line '.$line."\n"); |
||
| 20 | } |
||
| 21 | $stat = fstat($handle); |
||
| 22 | ftruncate($handle, $stat['size'] - 1); |
||
| 23 | fclose($handle); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function tearDown() |
||
| 27 | { |
||
| 28 | unlink($this->file); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testContextTop() |
||
| 32 | { |
||
| 33 | $context = new \Logfile\Context($this->file, 1); |
||
|
0 ignored issues
–
show
|
|||
| 34 | $this->assertCount(5, $context->getPlaceInFile()); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testContextMiddle() |
||
| 38 | { |
||
| 39 | $context = new \Logfile\Context($this->file, 10); |
||
| 40 | $this->assertCount(9, $context->getPlaceInFile()); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testContextBottom() |
||
| 44 | { |
||
| 45 | $context = new \Logfile\Context($this->file, 40); |
||
| 46 | $this->assertCount(5, $context->getPlaceInFile()); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths