1 | <?php |
||
22 | class LugUiBundleTest extends \PHPUnit_Framework_TestCase |
||
23 | { |
||
24 | /** |
||
25 | * @var LugUiBundle |
||
26 | */ |
||
27 | private $bundle; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | protected function setUp() |
||
33 | { |
||
34 | $this->bundle = new LugUiBundle(); |
||
35 | } |
||
36 | |||
37 | public function testInheritance() |
||
38 | { |
||
39 | $this->assertInstanceOf(Bundle::class, $this->bundle); |
||
40 | } |
||
41 | |||
42 | public function testBuild() |
||
43 | { |
||
44 | $container = $this->createContainerBuilderMock(); |
||
45 | $container |
||
46 | ->expects($this->once()) |
||
47 | ->method('addCompilerPass') |
||
48 | ->with($this->isInstanceOf(RegisterMenuPass::class)); |
||
49 | |||
50 | $this->bundle->build($container); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder |
||
55 | */ |
||
56 | private function createContainerBuilderMock() |
||
57 | { |
||
58 | return $this->getMock(ContainerBuilder::class, ['addCompilerPass']); |
||
59 | } |
||
60 | } |
||
61 |