1 | <?php |
||
24 | class IvoryCKEditorBundleTest extends AbstractTestCase |
||
25 | { |
||
26 | /** |
||
27 | * @var IvoryCKEditorBundle |
||
28 | */ |
||
29 | private $bundle; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | protected function setUp() |
||
35 | { |
||
36 | $this->bundle = new IvoryCKEditorBundle(); |
||
37 | } |
||
38 | |||
39 | public function testBundle() |
||
40 | { |
||
41 | $this->assertInstanceOf(Bundle::class, $this->bundle); |
||
42 | } |
||
43 | |||
44 | public function testCompilerPasses() |
||
45 | { |
||
46 | $containerBuilder = $this->createContainerBuilderMock(); |
||
47 | $containerBuilder |
||
48 | ->expects($this->at(0)) |
||
49 | ->method('addCompilerPass') |
||
50 | ->with($this->isInstanceOf(ResourceCompilerPass::class)) |
||
51 | ->will($this->returnSelf()); |
||
52 | |||
53 | $containerBuilder |
||
54 | ->expects($this->at(1)) |
||
55 | ->method('addCompilerPass') |
||
56 | ->with($this->isInstanceOf(TemplatingCompilerPass::class)) |
||
57 | ->will($this->returnSelf()); |
||
58 | |||
59 | $this->bundle->build($containerBuilder); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return ContainerBuilder|\PHPUnit_Framework_MockObject_MockObject |
||
64 | */ |
||
65 | private function createContainerBuilderMock() |
||
66 | { |
||
67 | return $this->getMockBuilder(ContainerBuilder::class) |
||
68 | ->disableOriginalConstructor() |
||
69 | ->setMethods(['addCompilerPass']) |
||
70 | ->getMock(); |
||
71 | } |
||
72 | } |
||
73 |