From f3a857f1335c7fd89be4ef191d07ac409e2f9c75 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Tue, 7 Jul 2015 14:17:12 +0100 Subject: [PATCH] Issue #2527710 by Fabianx: Decouple Error testing from running with container builder --- .../src/ErrorServiceTestServiceProvider.php | 28 +++++++++++++++++++ .../src/MonkeysInTheControlRoom.php | 6 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 core/modules/system/tests/modules/error_service_test/src/ErrorServiceTestServiceProvider.php diff --git a/core/modules/system/tests/modules/error_service_test/src/ErrorServiceTestServiceProvider.php b/core/modules/system/tests/modules/error_service_test/src/ErrorServiceTestServiceProvider.php new file mode 100644 index 00000000000..4a4aaafcb45 --- /dev/null +++ b/core/modules/system/tests/modules/error_service_test/src/ErrorServiceTestServiceProvider.php @@ -0,0 +1,28 @@ +rebuildContainer(); // 2) Fetch the in-situ container builder. - $container = $kernel->getContainer(); + $container = ErrorServiceTestServiceProvider::$containerBuilder; + // Ensure the compiler pass worked. + if (!$container) { + throw new \Exception('Oh oh, monkeys stole the ServiceProvider.'); + } // Stop the theme manager from being found - and triggering error // maintenance mode. $container->removeDefinition('theme.manager');