1+ <?php
2+
3+ /**
4+ *
5+ * This file is part of phpFastCache.
6+ *
7+ * @license MIT License (MIT)
8+ *
9+ * For full copyright and license information, please see the docs/CREDITS.txt file.
10+ *
11+ * @author Georges.L (Geolim4) <contact@geolim4.com>
12+ * @author PastisD https://github.com/PastisD
13+ *
14+ */
15+
16+ declare (strict_types=1 );
17+
18+ namespace Phpfastcache \Bundle \Tests \Functional \App ;
19+
20+ use Phpfastcache \Bundle \Tests \Functional \App \Controller \CacheController ;
21+ use Symfony \Bundle \FrameworkBundle \Kernel \MicroKernelTrait ;
22+ use Symfony \Component \Config \Loader \LoaderInterface ;
23+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
24+ use Symfony \Component \HttpKernel \Kernel as BaseKernel ;
25+ use Symfony \Component \Routing \RouteCollectionBuilder ;
26+
27+ /**
28+ * Class Kernel
29+ * @package Phpfastcache\Bundle\Tests\Functional\App
30+ */
31+ class Kernel extends BaseKernel
32+ {
33+ use MicroKernelTrait;
34+
35+ const CONFIG_EXTS = '.{php,xml,yaml,yml} ' ;
36+
37+ /**
38+ * @return array|iterable|\Symfony\Component\HttpKernel\Bundle\BundleInterface[]
39+ */
40+ public function registerBundles ()
41+ {
42+ return [
43+ new \Symfony \Bundle \FrameworkBundle \FrameworkBundle (),
44+ new \Symfony \Bundle \WebProfilerBundle \WebProfilerBundle (),
45+ new \Symfony \Bundle \TwigBundle \TwigBundle (),
46+ new \Phpfastcache \Bundle \PhpfastcacheBundle (),
47+ ];
48+ }
49+
50+ /**
51+ * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
52+ * @param \Symfony\Component\Config\Loader\LoaderInterface $loader
53+ * @throws \Exception
54+ */
55+ protected function configureContainer (ContainerBuilder $ container , LoaderInterface $ loader )
56+ {
57+ $ loader ->load (__DIR__ . '/config.yaml ' );
58+ }
59+
60+ /**
61+ * @param \Symfony\Component\Routing\RouteCollectionBuilder $routes
62+ */
63+ protected function configureRoutes (RouteCollectionBuilder $ routes )
64+ {
65+ $ routes ->add ('/ ' , CacheController::class . ':index ' );
66+ $ routes ->add ('/cache/miss ' , CacheController::class . ':cacheMiss ' );
67+ $ routes ->add ('/cache/hit ' , CacheController::class . ':cacheHit ' );
68+ }
69+
70+ /**
71+ * @return string
72+ */
73+ public function getRootDir ()
74+ {
75+ return __DIR__ . '/var ' ;
76+ }
77+
78+ /**
79+ * @return string
80+ */
81+ public function getProjectDir ()
82+ {
83+ return __DIR__ ;
84+ }
85+ }
0 commit comments