| 1 | <?php |
||
| 16 | class AppKernel extends SuluTestKernel |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | public function __construct($environment, $debug, $suluContext = self::CONTEXT_ADMIN) |
||
| 22 | { |
||
| 23 | $this->name = $suluContext; |
||
| 24 | |||
| 25 | parent::__construct($environment, $debug, $suluContext); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function registerBundles() |
||
| 32 | { |
||
| 33 | $bundles = array_merge( |
||
| 34 | [ |
||
| 35 | new SuluCommentBundle(), |
||
| 36 | ], |
||
| 37 | parent::registerBundles() |
||
| 38 | ); |
||
| 39 | |||
| 40 | if ($this->getContext() !== self::CONTEXT_ADMIN) { |
||
| 41 | $bundles[] = new \FOS\RestBundle\FOSRestBundle(); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $bundles; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function registerContainerConfiguration(LoaderInterface $loader) |
||
| 51 | { |
||
| 52 | parent::registerContainerConfiguration($loader); |
||
| 53 | |||
| 54 | $context = $this->getContext(); |
||
| 55 | $loader->load(__DIR__ . '/config/config_' . $context . '.yml'); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |