@@ 277-296 (lines=20) @@ | ||
274 | $this->assertEquals(array('en'), $object->getBackendLocales()); |
|
275 | } |
|
276 | ||
277 | private function getContainer($map, $request) |
|
278 | { |
|
279 | $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); |
|
280 | ||
281 | $container |
|
282 | ->method('getParameter') |
|
283 | ->willReturnMap($map); |
|
284 | ||
285 | $serviceMap = array( |
|
286 | array('request_stack', 1, $this->getRequestStack($request)), |
|
287 | array('doctrine.orm.entity_manager', 1, $this->getEntityManager()), |
|
288 | array('kunstmaan_admin.adminroute.helper', 1, $this->getAdminRouteHelper()), |
|
289 | ); |
|
290 | ||
291 | $container |
|
292 | ->method('get') |
|
293 | ->willReturnMap($serviceMap); |
|
294 | ||
295 | return $container; |
|
296 | } |
|
297 | ||
298 | private function getEntityManager() |
|
299 | { |
@@ 186-201 (lines=16) @@ | ||
183 | * |
|
184 | * @return Container |
|
185 | */ |
|
186 | private function getContainer($request, $nodeTranslation = null) |
|
187 | { |
|
188 | $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); |
|
189 | $serviceMap = array( |
|
190 | array('request_stack', 1, $this->getRequestStack($request)), |
|
191 | array('kunstmaan_admin.domain_configuration', 1, $this->getDomainConfiguration()), |
|
192 | array('doctrine.orm.entity_manager', 1, $this->getEntityManager($nodeTranslation)), |
|
193 | ); |
|
194 | ||
195 | $container |
|
196 | ->method('get') |
|
197 | ->willReturnMap($serviceMap); |
|
198 | ||
199 | /* @var Container $container */ |
|
200 | return $container; |
|
201 | } |
|
202 | ||
203 | private function getRequestStack($request) |
|
204 | { |