1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Bdf\PrimeBundle\Tests; |
4
|
|
|
|
5
|
|
|
require_once __DIR__.'/TestKernel.php'; |
6
|
|
|
|
7
|
|
|
use Bdf\Prime\Shell\PrimeShellCommand; |
|
|
|
|
8
|
|
|
use Bdf\PrimeBundle\PrimeBundle; |
9
|
|
|
use PHPUnit\Framework\TestCase; |
10
|
|
|
use Symfony\Bundle\FrameworkBundle\Console\Application; |
11
|
|
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
12
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
13
|
|
|
use Symfony\Component\Console\Command\LazyCommand; |
14
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
15
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
16
|
|
|
|
17
|
|
|
class WithPrimeShellTest extends TestCase |
18
|
|
|
{ |
19
|
|
|
private $kernel; |
20
|
|
|
|
21
|
|
|
protected function setUp(): void |
22
|
|
|
{ |
23
|
|
|
if (!class_exists(PrimeShellCommand::class)) { |
24
|
|
|
$this->markTestSkipped('PrimeShell not installed'); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
$this->kernel = new class('test', true) extends Kernel { |
28
|
|
|
use \Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
|
|
|
|
29
|
|
|
|
30
|
|
|
public function registerBundles(): iterable |
31
|
|
|
{ |
32
|
|
|
return [ |
33
|
|
|
new FrameworkBundle(), |
34
|
|
|
new PrimeBundle(), |
35
|
|
|
]; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) |
|
|
|
|
39
|
|
|
{ |
40
|
|
|
$loader->import(__DIR__.'/Fixtures/config.yaml'); |
|
|
|
|
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function configureRoutes($routes) |
|
|
|
|
44
|
|
|
{ |
45
|
|
|
} |
46
|
|
|
}; |
47
|
|
|
$this->kernel->boot(); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function testCommands() |
51
|
|
|
{ |
52
|
|
|
$app = new Application($this->kernel); |
53
|
|
|
|
54
|
|
|
$command = $app->get('prime:shell'); |
55
|
|
|
|
56
|
|
|
if ($command instanceof LazyCommand) { |
57
|
|
|
$command = $command->getCommand(); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
$this->assertInstanceOf(PrimeShellCommand::class, $command); |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|
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