From f9c6ea6c62daac81cf0199c399daffb23165de40 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 28 Jun 2018 15:35:31 +0200 Subject: [PATCH 1/3] Register routes sf 4.1 style --- Tests/Resources/app/AppKernel.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/Resources/app/AppKernel.php b/Tests/Resources/app/AppKernel.php index 5ed35f89..69e00e76 100644 --- a/Tests/Resources/app/AppKernel.php +++ b/Tests/Resources/app/AppKernel.php @@ -53,7 +53,14 @@ protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); - $routes->add('/', 'kernel:indexAction'); + + // If 4.1 + if (Kernel::MAJOR_VERSION === 4 && Kernel::MINOR_VERSION >= 1) { + $routes->add('/', 'kernel::indexAction'); + } else { + $routes->add('/', 'kernel:indexAction'); + } + } /** From 2caac78cf5c414c78ebda4c1f4466479abd32160 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 28 Jun 2018 15:40:32 +0200 Subject: [PATCH 2/3] Better logic --- Tests/Resources/app/AppKernel.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/Resources/app/AppKernel.php b/Tests/Resources/app/AppKernel.php index 69e00e76..e9d12321 100644 --- a/Tests/Resources/app/AppKernel.php +++ b/Tests/Resources/app/AppKernel.php @@ -54,13 +54,12 @@ protected function configureRoutes(RouteCollectionBuilder $routes) $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); - // If 4.1 - if (Kernel::MAJOR_VERSION === 4 && Kernel::MINOR_VERSION >= 1) { + if (Kernel::MAJOR_VERSION < 4 || (Kernel::MAJOR_VERSION === 4 && Kernel::MINOR_VERSION === 0)) { $routes->add('/', 'kernel::indexAction'); } else { + // If 4.1+ $routes->add('/', 'kernel:indexAction'); } - } /** From e4793c301deb1347ab272ed3a6d46b20c53b0086 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 28 Jun 2018 15:45:05 +0200 Subject: [PATCH 3/3] Typo --- Tests/Resources/app/AppKernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Resources/app/AppKernel.php b/Tests/Resources/app/AppKernel.php index e9d12321..2199ec37 100644 --- a/Tests/Resources/app/AppKernel.php +++ b/Tests/Resources/app/AppKernel.php @@ -55,10 +55,10 @@ protected function configureRoutes(RouteCollectionBuilder $routes) $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); if (Kernel::MAJOR_VERSION < 4 || (Kernel::MAJOR_VERSION === 4 && Kernel::MINOR_VERSION === 0)) { - $routes->add('/', 'kernel::indexAction'); + $routes->add('/', 'kernel:indexAction'); } else { // If 4.1+ - $routes->add('/', 'kernel:indexAction'); + $routes->add('/', 'kernel::indexAction'); } }