Skip to content

Commit

Permalink
Add test for container compilation
Browse files Browse the repository at this point in the history
To help catch changes in symfony container such as the ones in 3.3
  • Loading branch information
rdohms committed Jun 5, 2017
1 parent 1d3eddc commit 378585f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/DMS/Bundle/FilterBundle/Tests/Integration/ContainerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace DMS\DMS\Bundle\FilterBundle\Tests\Integration;

use DMS\Bundle\FilterBundle\DependencyInjection\DMSFilterExtension;
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ContainerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var ContainerBuilder
*/
private $container;

/**
* @before
* @return void
*/
public function buildContainer()
{
$this->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());
}

}
}

0 comments on commit 378585f

Please sign in to comment.