From c56263647ad7b5adbaa9f8491fa82dd25169996b Mon Sep 17 00:00:00 2001 From: Joel Wurtz Date: Mon, 18 Jan 2016 16:41:58 +0100 Subject: [PATCH] Use separate configuration for sf27 and above, add parent bundle for sf26 and earlier --- GifExceptionBundle.php | 5 +++++ Tests/app/AppKernel.php | 6 ++++++ Tests/app/config/config.yml | 4 ++++ Tests/app/config/config_27.yml | 3 +++ Tests/app/config/routing.yml | 0 5 files changed, 18 insertions(+) create mode 100644 Tests/app/config/config_27.yml create mode 100644 Tests/app/config/routing.yml diff --git a/GifExceptionBundle.php b/GifExceptionBundle.php index 26def08..d3e601a 100644 --- a/GifExceptionBundle.php +++ b/GifExceptionBundle.php @@ -21,4 +21,9 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new PrepareTwigPass(), PassConfig::TYPE_BEFORE_REMOVING); } + + public function getParent() + { + return 'TwigBundle'; + } } diff --git a/Tests/app/AppKernel.php b/Tests/app/AppKernel.php index 8cde8f5..e008550 100644 --- a/Tests/app/AppKernel.php +++ b/Tests/app/AppKernel.php @@ -35,6 +35,12 @@ public function registerBundles() */ public function registerContainerConfiguration(LoaderInterface $loader) { + if (version_compare(self::VERSION, '2.7.0', '>=')) { + $loader->load($this->getRootDir() . '/config/config_27.yml'); + + return; + } + $loader->load($this->getRootDir() . '/config/config.yml'); } } diff --git a/Tests/app/config/config.yml b/Tests/app/config/config.yml index f88c658..0ff52ee 100644 --- a/Tests/app/config/config.yml +++ b/Tests/app/config/config.yml @@ -1,2 +1,6 @@ framework: + templating: { engines: ['twig'] } + router: + resource: "%kernel.root_dir%/config/routing.yml" + strict_requirements: ~ secret: "ThisTokenIsEnoughSecretForOurTests" diff --git a/Tests/app/config/config_27.yml b/Tests/app/config/config_27.yml new file mode 100644 index 0000000..6ae2bfc --- /dev/null +++ b/Tests/app/config/config_27.yml @@ -0,0 +1,3 @@ +framework: + secret: "ThisTokenIsEnoughSecretForOurTests" + assets: ~ diff --git a/Tests/app/config/routing.yml b/Tests/app/config/routing.yml new file mode 100644 index 0000000..e69de29