| @@ 192-218 (lines=27) @@ | ||
| 189 | $loader->populate($container, $config); |
|
| 190 | } |
|
| 191 | ||
| 192 | public function testAddingAliasWithArgument() |
|
| 193 | { |
|
| 194 | $loader = $this->obj; |
|
| 195 | ||
| 196 | $config = [ |
|
| 197 | 'TestInterface' => [ |
|
| 198 | 'class' => 'TestWithArguments', |
|
| 199 | 'arguments' => ['test', 'arguments'], |
|
| 200 | ], |
|
| 201 | ]; |
|
| 202 | ||
| 203 | $container = $this->getContainerMock(); |
|
| 204 | ||
| 205 | $definition = $this->getDefinitionMock(); |
|
| 206 | ||
| 207 | $definition->expects($this->once()) |
|
| 208 | ->method('withArguments') |
|
| 209 | ->with(['test', 'arguments']) |
|
| 210 | ->willReturn($definition); |
|
| 211 | ||
| 212 | $container->expects($this->once()) |
|
| 213 | ->method('add') |
|
| 214 | ->with('TestInterface', 'TestWithArguments', false) |
|
| 215 | ->willReturn($definition); |
|
| 216 | ||
| 217 | $loader->populate($container, $config); |
|
| 218 | } |
|
| 219 | ||
| 220 | ||
| 221 | public function testAddingAliasWithMethodCalls() |
|
| @@ 221-249 (lines=29) @@ | ||
| 218 | } |
|
| 219 | ||
| 220 | ||
| 221 | public function testAddingAliasWithMethodCalls() |
|
| 222 | { |
|
| 223 | $loader = $this->obj; |
|
| 224 | ||
| 225 | $config = [ |
|
| 226 | 'TestInterface' => [ |
|
| 227 | 'class' => 'TestWithMethodCalls', |
|
| 228 | 'methods' => [ |
|
| 229 | 'setValue' => ['test value'], |
|
| 230 | ], |
|
| 231 | ], |
|
| 232 | ]; |
|
| 233 | ||
| 234 | $container = $this->getContainerMock(); |
|
| 235 | ||
| 236 | $definition = $this->getClassDefinitionMock(); |
|
| 237 | ||
| 238 | $definition->expects($this->once()) |
|
| 239 | ->method('withMethodCalls') |
|
| 240 | ->with(['setValue' => ['test value']]) |
|
| 241 | ->willReturn($definition); |
|
| 242 | ||
| 243 | $container->expects($this->once()) |
|
| 244 | ->method('add') |
|
| 245 | ->with('TestInterface', 'TestWithMethodCalls', false) |
|
| 246 | ->willReturn($definition); |
|
| 247 | ||
| 248 | $loader->populate($container, $config); |
|
| 249 | } |
|
| 250 | ||
| 251 | public function testAddingAliasWithArgumentsAndMethodCalls() |
|
| 252 | { |
|