1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Sonata Project package. |
7
|
|
|
* |
8
|
|
|
* (c) Thomas Rabaix <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Sonata\EasyExtendsBundle\Tests\Command\Functional; |
15
|
|
|
|
16
|
|
|
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
17
|
|
|
use Sonata\EasyExtendsBundle\SonataEasyExtendsBundle; |
18
|
|
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
19
|
|
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
20
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
21
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
22
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
23
|
|
|
use Symfony\Component\Routing\RouteCollectionBuilder; |
24
|
|
|
|
25
|
|
|
final class AppKernel extends Kernel |
26
|
|
|
{ |
27
|
|
|
use MicroKernelTrait; |
28
|
|
|
|
29
|
|
|
public function __construct() |
30
|
|
|
{ |
31
|
|
|
parent::__construct('test', false); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function registerBundles() |
35
|
|
|
{ |
36
|
|
|
return [ |
37
|
|
|
new FrameworkBundle(), |
38
|
|
|
new DoctrineBundle(), |
39
|
|
|
new SonataEasyExtendsBundle(), |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function getCacheDir(): string |
44
|
|
|
{ |
45
|
|
|
return $this->getBaseDir().'cache'; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function getLogDir(): string |
49
|
|
|
{ |
50
|
|
|
return $this->getBaseDir().'log'; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function getProjectDir(): string |
54
|
|
|
{ |
55
|
|
|
return __DIR__; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
protected function configureRoutes(RouteCollectionBuilder $routes): void |
|
|
|
|
59
|
|
|
{ |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
protected function configureContainer(ContainerBuilder $containerBuilder, LoaderInterface $loader): void |
|
|
|
|
63
|
|
|
{ |
64
|
|
|
$containerBuilder->loadFromExtension('framework', [ |
65
|
|
|
'secret' => 'MySecret', |
66
|
|
|
]); |
67
|
|
|
|
68
|
|
|
$containerBuilder->loadFromExtension('doctrine', [ |
69
|
|
|
'orm' => [ |
70
|
|
|
'entity_managers' => [ |
71
|
|
|
'default' => [ |
72
|
|
|
'auto_mapping' => true, |
73
|
|
|
'mappings' => [ |
74
|
|
|
'App' => [ |
75
|
|
|
'type' => 'annotation', |
76
|
|
|
'dir' => '%kernel.project_dir%/Entity', |
77
|
|
|
'is_bundle' => false, |
78
|
|
|
'prefix' => 'Sonata\EasyExtendsBundle\Tests\Command\Functional\Entity', |
79
|
|
|
'alias' => 'SonataFunctional', |
80
|
|
|
], |
81
|
|
|
], |
82
|
|
|
], |
83
|
|
|
], |
84
|
|
|
], |
85
|
|
|
'dbal' => [ |
86
|
|
|
'driver' => 'pdo_sqlite', |
87
|
|
|
], |
88
|
|
|
]); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
private function getBaseDir(): string |
92
|
|
|
{ |
93
|
|
|
return sys_get_temp_dir().'/sonata-easy-extends-bundle/var/'; |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.