| @@ 18-38 (lines=21) @@ | ||
| 15 | $this->assertInstanceOf('Symfony\Component\HttpKernel\Bundle\Bundle', new LiipImagineBundle()); |
|
| 16 | } |
|
| 17 | ||
| 18 | public function testAddLoadersCompilerPassOnBuild() |
|
| 19 | { |
|
| 20 | $containerMock = $this->createContainerBuilderMock(); |
|
| 21 | $containerMock |
|
| 22 | ->expects($this->atLeastOnce()) |
|
| 23 | ->method('getExtension') |
|
| 24 | ->with('liip_imagine') |
|
| 25 | ->will($this->returnValue($this->createExtensionMock())) |
|
| 26 | ; |
|
| 27 | $containerMock |
|
| 28 | ->expects($this->at(0)) |
|
| 29 | ->method('addCompilerPass') |
|
| 30 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Compiler\LoadersCompilerPass')) |
|
| 31 | ; |
|
| 32 | ||
| 33 | $container = new ContainerBuilder(); |
|
| 34 | ||
| 35 | $bundle = new LiipImagineBundle(); |
|
| 36 | ||
| 37 | $bundle->build($containerMock); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testAddFiltersCompilerPassOnBuild() |
|
| 41 | { |
|
| @@ 40-58 (lines=19) @@ | ||
| 37 | $bundle->build($containerMock); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testAddFiltersCompilerPassOnBuild() |
|
| 41 | { |
|
| 42 | $containerMock = $this->createContainerBuilderMock(); |
|
| 43 | $containerMock |
|
| 44 | ->expects($this->atLeastOnce()) |
|
| 45 | ->method('getExtension') |
|
| 46 | ->with('liip_imagine') |
|
| 47 | ->will($this->returnValue($this->createExtensionMock())) |
|
| 48 | ; |
|
| 49 | $containerMock |
|
| 50 | ->expects($this->at(1)) |
|
| 51 | ->method('addCompilerPass') |
|
| 52 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Compiler\FiltersCompilerPass')) |
|
| 53 | ; |
|
| 54 | ||
| 55 | $bundle = new LiipImagineBundle(); |
|
| 56 | ||
| 57 | $bundle->build($containerMock); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function testAddPostProcessorsCompilerPassOnBuild() |
|
| 61 | { |
|
| @@ 60-78 (lines=19) @@ | ||
| 57 | $bundle->build($containerMock); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function testAddPostProcessorsCompilerPassOnBuild() |
|
| 61 | { |
|
| 62 | $containerMock = $this->createContainerBuilderMock(); |
|
| 63 | $containerMock |
|
| 64 | ->expects($this->atLeastOnce()) |
|
| 65 | ->method('getExtension') |
|
| 66 | ->with('liip_imagine') |
|
| 67 | ->will($this->returnValue($this->createExtensionMock())) |
|
| 68 | ; |
|
| 69 | $containerMock |
|
| 70 | ->expects($this->at(2)) |
|
| 71 | ->method('addCompilerPass') |
|
| 72 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Compiler\PostProcessorsCompilerPass')) |
|
| 73 | ; |
|
| 74 | ||
| 75 | $bundle = new LiipImagineBundle(); |
|
| 76 | ||
| 77 | $bundle->build($containerMock); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testAddResolversCompilerPassOnBuild() |
|
| 81 | { |
|
| @@ 80-98 (lines=19) @@ | ||
| 77 | $bundle->build($containerMock); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testAddResolversCompilerPassOnBuild() |
|
| 81 | { |
|
| 82 | $containerMock = $this->createContainerBuilderMock(); |
|
| 83 | $containerMock |
|
| 84 | ->expects($this->atLeastOnce()) |
|
| 85 | ->method('getExtension') |
|
| 86 | ->with('liip_imagine') |
|
| 87 | ->will($this->returnValue($this->createExtensionMock())) |
|
| 88 | ; |
|
| 89 | $containerMock |
|
| 90 | ->expects($this->at(3)) |
|
| 91 | ->method('addCompilerPass') |
|
| 92 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Compiler\ResolversCompilerPass')) |
|
| 93 | ; |
|
| 94 | ||
| 95 | $bundle = new LiipImagineBundle(); |
|
| 96 | ||
| 97 | $bundle->build($containerMock); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testAddWebPathResolverFactoryOnBuild() |
|
| 101 | { |
|
| @@ 100-120 (lines=21) @@ | ||
| 97 | $bundle->build($containerMock); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testAddWebPathResolverFactoryOnBuild() |
|
| 101 | { |
|
| 102 | $extensionMock = $this->createExtensionMock(); |
|
| 103 | $extensionMock |
|
| 104 | ->expects($this->at(0)) |
|
| 105 | ->method('addResolverFactory') |
|
| 106 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Factory\Resolver\WebPathResolverFactory')) |
|
| 107 | ; |
|
| 108 | ||
| 109 | $containerMock = $this->createContainerBuilderMock(); |
|
| 110 | $containerMock |
|
| 111 | ->expects($this->atLeastOnce()) |
|
| 112 | ->method('getExtension') |
|
| 113 | ->with('liip_imagine') |
|
| 114 | ->will($this->returnValue($extensionMock)) |
|
| 115 | ; |
|
| 116 | ||
| 117 | $bundle = new LiipImagineBundle(); |
|
| 118 | ||
| 119 | $bundle->build($containerMock); |
|
| 120 | } |
|
| 121 | ||
| 122 | public function testAddAwsS3ResolverFactoryOnBuild() |
|
| 123 | { |
|
| @@ 122-142 (lines=21) @@ | ||
| 119 | $bundle->build($containerMock); |
|
| 120 | } |
|
| 121 | ||
| 122 | public function testAddAwsS3ResolverFactoryOnBuild() |
|
| 123 | { |
|
| 124 | $extensionMock = $this->createExtensionMock(); |
|
| 125 | $extensionMock |
|
| 126 | ->expects($this->at(1)) |
|
| 127 | ->method('addResolverFactory') |
|
| 128 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Factory\Resolver\AwsS3ResolverFactory')) |
|
| 129 | ; |
|
| 130 | ||
| 131 | $containerMock = $this->createContainerBuilderMock(); |
|
| 132 | $containerMock |
|
| 133 | ->expects($this->atLeastOnce()) |
|
| 134 | ->method('getExtension') |
|
| 135 | ->with('liip_imagine') |
|
| 136 | ->will($this->returnValue($extensionMock)) |
|
| 137 | ; |
|
| 138 | ||
| 139 | $bundle = new LiipImagineBundle(); |
|
| 140 | ||
| 141 | $bundle->build($containerMock); |
|
| 142 | } |
|
| 143 | ||
| 144 | public function testAddStreamLoaderFactoryOnBuild() |
|
| 145 | { |
|
| @@ 144-164 (lines=21) @@ | ||
| 141 | $bundle->build($containerMock); |
|
| 142 | } |
|
| 143 | ||
| 144 | public function testAddStreamLoaderFactoryOnBuild() |
|
| 145 | { |
|
| 146 | $extensionMock = $this->createExtensionMock(); |
|
| 147 | $extensionMock |
|
| 148 | ->expects($this->at(2)) |
|
| 149 | ->method('addLoaderFactory') |
|
| 150 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Factory\Loader\StreamLoaderFactory')) |
|
| 151 | ; |
|
| 152 | ||
| 153 | $containerMock = $this->createContainerBuilderMock(); |
|
| 154 | $containerMock |
|
| 155 | ->expects($this->atLeastOnce()) |
|
| 156 | ->method('getExtension') |
|
| 157 | ->with('liip_imagine') |
|
| 158 | ->will($this->returnValue($extensionMock)) |
|
| 159 | ; |
|
| 160 | ||
| 161 | $bundle = new LiipImagineBundle(); |
|
| 162 | ||
| 163 | $bundle->build($containerMock); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function testAddFilesystemLoaderFactoryOnBuild() |
|
| 167 | { |
|
| @@ 166-186 (lines=21) @@ | ||
| 163 | $bundle->build($containerMock); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function testAddFilesystemLoaderFactoryOnBuild() |
|
| 167 | { |
|
| 168 | $extensionMock = $this->createExtensionMock(); |
|
| 169 | $extensionMock |
|
| 170 | ->expects($this->at(3)) |
|
| 171 | ->method('addLoaderFactory') |
|
| 172 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Factory\Loader\FilesystemLoaderFactory')) |
|
| 173 | ; |
|
| 174 | ||
| 175 | $containerMock = $this->createContainerBuilderMock(); |
|
| 176 | $containerMock |
|
| 177 | ->expects($this->atLeastOnce()) |
|
| 178 | ->method('getExtension') |
|
| 179 | ->with('liip_imagine') |
|
| 180 | ->will($this->returnValue($extensionMock)) |
|
| 181 | ; |
|
| 182 | ||
| 183 | $bundle = new LiipImagineBundle(); |
|
| 184 | ||
| 185 | $bundle->build($containerMock); |
|
| 186 | } |
|
| 187 | ||
| 188 | public function testAddFlysystemLoaderFactoryOnBuild() |
|
| 189 | { |
|
| @@ 188-208 (lines=21) @@ | ||
| 185 | $bundle->build($containerMock); |
|
| 186 | } |
|
| 187 | ||
| 188 | public function testAddFlysystemLoaderFactoryOnBuild() |
|
| 189 | { |
|
| 190 | $extensionMock = $this->createExtensionMock(); |
|
| 191 | $extensionMock |
|
| 192 | ->expects($this->at(4)) |
|
| 193 | ->method('addLoaderFactory') |
|
| 194 | ->with($this->isInstanceOf('Liip\ImagineBundle\DependencyInjection\Factory\Loader\FlysystemLoaderFactory')) |
|
| 195 | ; |
|
| 196 | ||
| 197 | $containerMock = $this->createContainerBuilderMock(); |
|
| 198 | $containerMock |
|
| 199 | ->expects($this->atLeastOnce()) |
|
| 200 | ->method('getExtension') |
|
| 201 | ->with('liip_imagine') |
|
| 202 | ->will($this->returnValue($extensionMock)) |
|
| 203 | ; |
|
| 204 | ||
| 205 | $bundle = new LiipImagineBundle(); |
|
| 206 | ||
| 207 | $bundle->build($containerMock); |
|
| 208 | } |
|
| 209 | ||
| 210 | protected function createContainerBuilderMock() |
|
| 211 | { |
|