lluiscamino /
phpDoc2pdf
| 1 | <?php |
||
| 2 | namespace tests; |
||
| 3 | |||
| 4 | require '../vendor/autoload.php'; |
||
| 5 | require '../src/application/FilesTreatment.php'; |
||
| 6 | |||
| 7 | use phpDocumentor\Reflection\File\LocalFile; |
||
| 8 | use PHPUnit\Framework\TestCase; |
||
|
0 ignored issues
–
show
|
|||
| 9 | use application\FilesTreatment; |
||
| 10 | |||
| 11 | class FilesTreatmentTest extends TestCase |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @test |
||
| 15 | */ |
||
| 16 | public function FilesTreatmentCannotBeInstantiatedFromInvalidFile(): void { |
||
| 17 | $this->expectException(\Exception::class); |
||
| 18 | new FilesTreatment('invalid-file.php'); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @test |
||
| 23 | */ |
||
| 24 | public function FilesTreatmentCannotBeInstantiatedFromInvalidPath(): void { |
||
| 25 | $this->expectException(\Exception::class); |
||
| 26 | new FilesTreatment('invalid-path'); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @test |
||
| 31 | * @throws \Exception |
||
| 32 | */ |
||
| 33 | public function filesFromDirectoryAreCorrect(): void { |
||
| 34 | $attribute = (new \ReflectionClass('application\FilesTreatment'))->getProperty('files'); |
||
| 35 | $attribute->setAccessible(true); |
||
| 36 | $filesAttribute = array_map(function(LocalFile $localFileObject): string { |
||
| 37 | $localFileObjectAttribute = (new \ReflectionClass('\phpDocumentor\Reflection\File\LocalFile'))->getProperty('path'); |
||
| 38 | $localFileObjectAttribute->setAccessible(true); |
||
| 39 | return $localFileObjectAttribute->getValue($localFileObject); |
||
| 40 | }, ($attribute->getValue(new FilesTreatment(dirname(__DIR__ . '/tests'))))); |
||
| 41 | $expectedFilesAttribute = array( |
||
| 42 | dirname(__DIR__) . '/tests/FilesTreatmentTest.php', |
||
| 43 | dirname(__DIR__) . '/tests/PDFFileTest.php' |
||
| 44 | ); |
||
| 45 | $this->assertEquals($expectedFilesAttribute, $filesAttribute); |
||
| 46 | } |
||
| 47 | } |
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