|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Webfactory\ShortcodeBundle\Tests\Fixtures; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
|
6
|
|
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
|
7
|
|
|
use Symfony\Bundle\TwigBundle\TwigBundle; |
|
8
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
|
9
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
10
|
|
|
use Symfony\Component\HttpKernel\Bundle\BundleInterface; |
|
11
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
|
12
|
|
|
use Symfony\Component\Routing\RouteCollectionBuilder; |
|
13
|
|
|
use Webfactory\ShortcodeBundle\WebfactoryShortcodeBundle; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* A minimal kernel that is used for testing. |
|
17
|
|
|
*/ |
|
18
|
|
|
final class TestKernel extends Kernel |
|
19
|
|
|
{ |
|
20
|
|
|
use MicroKernelTrait; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @return BundleInterface[] An array of bundle instances |
|
24
|
|
|
*/ |
|
25
|
|
|
public function registerBundles(): array |
|
26
|
|
|
{ |
|
27
|
|
|
return [ |
|
28
|
|
|
new FrameworkBundle(), |
|
29
|
|
|
new TwigBundle(), |
|
30
|
|
|
new WebfactoryShortcodeBundle(), |
|
31
|
|
|
]; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
|
35
|
|
|
{ |
|
36
|
|
|
$loader->load(__DIR__.'/config/config.yml'); |
|
37
|
|
|
$loader->load(__DIR__.'/config/test_shortcodes.xml'); |
|
38
|
|
|
$container->addCompilerPass(new PublicFragmentHandlerClass()); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function getCacheDir(): string |
|
42
|
|
|
{ |
|
43
|
|
|
return __DIR__.'/cache/'.$this->environment; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function getLogDir(): string |
|
47
|
|
|
{ |
|
48
|
|
|
return __DIR__.'/logs'; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Add or import routes into your application. |
|
53
|
|
|
* |
|
54
|
|
|
* $routes->import('config/routing.yml'); |
|
55
|
|
|
* $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard'); |
|
56
|
|
|
* |
|
57
|
|
|
* @param RouteCollectionBuilder $routes |
|
58
|
|
|
*/ |
|
59
|
|
|
protected function configureRoutes(RouteCollectionBuilder $routes): void |
|
|
|
|
|
|
60
|
|
|
{ |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.