11
11
12
12
namespace Symfony \Cmf \Component \Testing \HttpKernel ;
13
13
14
- use Symfony \Component \HttpKernel \Kernel ;
14
+ use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
15
+ use Doctrine \Bundle \PHPCRBundle \DoctrinePHPCRBundle ;
16
+ use FOS \JsRoutingBundle \FOSJsRoutingBundle ;
17
+ use Knp \Bundle \MenuBundle \KnpMenuBundle ;
18
+ use Sonata \AdminBundle \SonataAdminBundle ;
19
+ use Sonata \BlockBundle \SonataBlockBundle ;
20
+ use Sonata \CoreBundle \SonataCoreBundle ;
21
+ use Sonata \DoctrineORMAdminBundle \SonataDoctrineORMAdminBundle ;
22
+ use Sonata \DoctrinePHPCRAdminBundle \SonataDoctrinePHPCRAdminBundle ;
23
+ use Sonata \jQueryBundle \SonatajQueryBundle ;
24
+ use Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
25
+ use Symfony \Bundle \MonologBundle \MonologBundle ;
26
+ use Symfony \Bundle \SecurityBundle \SecurityBundle ;
27
+ use Symfony \Bundle \TwigBundle \TwigBundle ;
28
+ use Symfony \Bundle \WebServerBundle \WebServerBundle ;
29
+ use Symfony \Cmf \Bundle \TreeBrowserBundle \CmfTreeBrowserBundle ;
15
30
use Symfony \Component \HttpKernel \Bundle \BundleInterface ;
31
+ use Symfony \Component \HttpKernel \Kernel ;
16
32
17
33
/**
18
34
* TestKernel base class for Symfony CMF Bundle
@@ -33,42 +49,43 @@ abstract class TestKernel extends Kernel
33
49
*/
34
50
public function __construct ($ env , $ debug )
35
51
{
36
- $ this ->registerBundleSet ('default ' , array (
37
- 'Symfony\Bundle\FrameworkBundle\FrameworkBundle ' ,
38
- 'Symfony\Bundle\SecurityBundle\SecurityBundle ' ,
39
- 'Symfony\Bundle\TwigBundle\TwigBundle ' ,
40
- 'Symfony\Bundle\MonologBundle\MonologBundle ' ,
41
- ));
52
+ $ defaultBundles = [
53
+ FrameworkBundle::class,
54
+ SecurityBundle::class,
55
+ TwigBundle::class,
56
+ MonologBundle::class,
57
+ ];
58
+
59
+ if (class_exists (WebServerBundle::class)) {
60
+ $ defaultBundles [] = WebServerBundle::class;
61
+ }
42
62
43
- $ this ->registerBundleSet ('phpcr_odm ' , array (
44
- 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle ' ,
45
- 'Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle ' ,
46
- ));
63
+ $ this ->registerBundleSet ('default ' , $ defaultBundles );
47
64
48
- $ this ->registerBundleSet ('doctrine_orm ' , array (
49
- 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle ' ,
50
- ));
65
+ $ this ->registerBundleSet ('phpcr_odm ' , [DoctrineBundle::class, DoctrinePHPCRBundle::class]);
66
+ $ this ->registerBundleSet ('doctrine_orm ' , [DoctrineBundle::class]);
51
67
52
- $ baseSonataBundles = array (
53
- ' Sonata\BlockBundle\ SonataBlockBundle' ,
54
- ' Sonata\CoreBundle\ SonataCoreBundle' ,
55
- ' Sonata\AdminBundle\ SonataAdminBundle' ,
56
- ' Knp\Bundle\MenuBundle\ KnpMenuBundle' ,
57
- ' FOS\JsRoutingBundle\ FOSJsRoutingBundle' ,
58
- ) ;
68
+ $ baseSonataBundles = [
69
+ SonataBlockBundle::class ,
70
+ SonataCoreBundle::class ,
71
+ SonataAdminBundle::class ,
72
+ KnpMenuBundle::class ,
73
+ FOSJsRoutingBundle::class ,
74
+ ] ;
59
75
60
- if (class_exists (' Sonata\jQueryBundle\ SonatajQueryBundle' )) {
61
- $ baseSonataBundles [] = ' Sonata\jQueryBundle\ SonatajQueryBundle' ;
76
+ if (class_exists (SonatajQueryBundle::class )) {
77
+ $ baseSonataBundles [] = SonatajQueryBundle::class ;
62
78
}
63
79
64
- $ this ->registerBundleSet ('sonata_admin_orm ' , array_merge (array (
65
- 'Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle ' ,
66
- ), $ baseSonataBundles ));
80
+ $ this ->registerBundleSet ('sonata_admin_orm ' , array_merge (
81
+ [SonataDoctrineORMAdminBundle::class],
82
+ $ baseSonataBundles
83
+ ));
67
84
68
- $ this ->registerBundleSet ('sonata_admin_phpcr ' , array_merge (array (
69
- ' Sonata\DoctrinePHPCRAdminBundle\ SonataDoctrinePHPCRAdminBundle' ,
70
- ' Symfony\Cmf\Bundle\TreeBrowserBundle\ CmfTreeBrowserBundle' ,
71
- ) , $ baseSonataBundles ));
85
+ $ this ->registerBundleSet ('sonata_admin_phpcr ' , array_merge ([
86
+ SonataDoctrinePHPCRAdminBundle::class ,
87
+ CmfTreeBrowserBundle::class ,
88
+ ] , $ baseSonataBundles ));
72
89
73
90
parent ::__construct ($ env , $ debug );
74
91
$ this ->configure ();
0 commit comments