@@ 38-62 (lines=25) @@ | ||
35 | $this->compiler = new ReplaceBase64FileExtensionPass(); |
|
36 | } |
|
37 | ||
38 | public function testProcess() |
|
39 | { |
|
40 | $container = $this->createContainerBuilderMock(); |
|
41 | $container |
|
42 | ->expects($this->once()) |
|
43 | ->method('getDefinition') |
|
44 | ->with($this->identicalTo('ivory.base64_file.form.extension')) |
|
45 | ->will($this->returnValue($definition = $this->createDefinitionMock())); |
|
46 | ||
47 | $definition |
|
48 | ->expects($this->once()) |
|
49 | ->method('setClass') |
|
50 | ->with($this->identicalTo(Base64FileExtension::class)) |
|
51 | ->will($this->returnSelf()); |
|
52 | ||
53 | $definition |
|
54 | ->expects($this->once()) |
|
55 | ->method('addArgument') |
|
56 | ->with($this->callback(function ($reference) { |
|
57 | return $reference instanceof Reference |
|
58 | && (string) $reference === 'lug.resource.routing.parameter_resolver'; |
|
59 | })); |
|
60 | ||
61 | $this->compiler->process($container); |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @return \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder |
@@ 44-69 (lines=26) @@ | ||
41 | $this->assertInstanceOf(CompilerPassInterface::class, $this->compiler); |
|
42 | } |
|
43 | ||
44 | public function testProcess() |
|
45 | { |
|
46 | $container = $this->createContainerBuilderMock(); |
|
47 | $container |
|
48 | ->expects($this->once()) |
|
49 | ->method('getDefinition') |
|
50 | ->with($this->identicalTo('fos_rest.form.extension.boolean')) |
|
51 | ->will($this->returnValue($definition = $this->createDefinitionMock())); |
|
52 | ||
53 | $definition |
|
54 | ->expects($this->once()) |
|
55 | ->method('setClass') |
|
56 | ->with($this->identicalTo(BooleanExtension::class)) |
|
57 | ->will($this->returnSelf()); |
|
58 | ||
59 | $definition |
|
60 | ->expects($this->once()) |
|
61 | ->method('addArgument') |
|
62 | ->with($this->callback(function ($reference) { |
|
63 | return $reference instanceof Reference |
|
64 | && (string) $reference === 'lug.resource.routing.parameter_resolver'; |
|
65 | })) |
|
66 | ->will($this->returnSelf()); |
|
67 | ||
68 | $this->compiler->process($container); |
|
69 | } |
|
70 | ||
71 | /** |
|
72 | * @return \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder |