2016-07-29 10:22:40 +02:00

62 lines
1.6 KiB
PHP

<?php
/*
* This file is part of the ApiDocBundle package.
*
* (c) EXSyst
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle;
use EXSyst\Bundle\ApiDocBundle\EXSystApiDocBundle;
use EXSyst\Bundle\ApiDocBundle\Tests\Functional\TestBundle;
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
class TestKernel extends Kernel
{
use MicroKernelTrait;
/**
* {@inheritdoc}
*/
public function registerBundles()
{
return [
new FrameworkBundle(),
new SensioFrameworkExtraBundle(),
new ApiPlatformBundle(),
new EXSystApiDocBundle(),
new TestBundle(),
];
}
/**
* {@inheritdoc}
*/
protected function configureRoutes(RouteCollectionBuilder $routes)
{
$routes->import(__DIR__.'/Controller/', '/', 'annotation');
$routes->import('', '/api', 'api_platform');
}
/**
* {@inheritdoc}
*/
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
$c->loadFromExtension('framework', [
'secret' => 'MySecretKey',
'test' => null,
'validation' => null,
]);
}
}