From 378585fd4f93de9626af119353b9a792b5f0e08e Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Mon, 5 Jun 2017 11:39:03 +0200 Subject: [PATCH] Add test for container compilation To help catch changes in symfony container such as the ones in 3.3 --- .../Tests/Integration/ContainerTest.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/DMS/Bundle/FilterBundle/Tests/Integration/ContainerTest.php diff --git a/src/DMS/Bundle/FilterBundle/Tests/Integration/ContainerTest.php b/src/DMS/Bundle/FilterBundle/Tests/Integration/ContainerTest.php new file mode 100644 index 0000000..c4c28a2 --- /dev/null +++ b/src/DMS/Bundle/FilterBundle/Tests/Integration/ContainerTest.php @@ -0,0 +1,44 @@ +container = new ContainerBuilder(); + + // Cover external dependencies + $this->container->set('annotation_reader', $this->prophesize(AnnotationReader::class)->reveal()); + + $extension = new DMSFilterExtension(); + $extension->load([], $this->container); + + $this->container->compile(); + } + + public function testContainerBoots() + { + $this->container->get('dms.filter'); + + if (method_exists($this->container, 'isCompiled')) { + self::assertTrue($this->container->isCompiled()); + } else { + self::assertTrue($this->container->isFrozen()); + } + + } +}