1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the EloyekunlePermissionsBundle package. |
5
|
|
|
* |
6
|
|
|
* (c) Elijah Oyekunle <https://elijahoyekunle.com/> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Eloyekunle\PermissionsBundle\Tests; |
13
|
|
|
|
14
|
|
|
use Eloyekunle\PermissionsBundle\DependencyInjection\Compiler\DoctrineMappingPass; |
15
|
|
|
use Eloyekunle\PermissionsBundle\DependencyInjection\Compiler\ValidationPass; |
16
|
|
|
use Eloyekunle\PermissionsBundle\EloyekunlePermissionsBundle; |
17
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
18
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
19
|
|
|
|
20
|
|
|
class BundleTest extends TestCase |
21
|
|
|
{ |
22
|
|
|
public function testBuildCompilerPasses() |
23
|
|
|
{ |
24
|
|
|
$container = new ContainerBuilder(); |
25
|
|
|
$bundle = new EloyekunlePermissionsBundle(); |
26
|
|
|
$bundle->build($container); |
27
|
|
|
|
28
|
|
|
$config = $container->getCompilerPassConfig(); |
29
|
|
|
$passes = $config->getBeforeOptimizationPasses(); |
30
|
|
|
|
31
|
|
|
$foundMappingPass = false; |
32
|
|
|
$foundValidation = false; |
33
|
|
|
|
34
|
|
|
foreach ($passes as $pass) { |
35
|
|
|
if ($pass instanceof ValidationPass) { |
36
|
|
|
$foundValidation = true; |
37
|
|
|
} elseif ($pass instanceof DoctrineMappingPass) { |
38
|
|
|
$foundMappingPass = true; |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
$this->assertTrue($foundMappingPass, 'DoctrineMappingPass was not found'); |
43
|
|
|
$this->assertTrue($foundValidation, 'ValidationPass was not found'); |
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
|
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