Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c296ad2

Browse filesBrowse files
[FrameworkBundle] fix tests
1 parent b19200c commit c296ad2
Copy full SHA for c296ad2

File tree

Expand file treeCollapse file tree

2 files changed

+17
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+17
-8
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ public function testProcess()
5555
'Test\private_used_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_shared_service')),
5656
'Test\private_used_non_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_non_shared_service')),
5757
'Test\soon_private_service' => new ServiceClosureArgument(new Reference('.container.private.Test\soon_private_service')),
58-
'Psr\Container\ContainerInterface' => new ServiceClosureArgument(new Reference('service_container')),
59-
'Symfony\Component\DependencyInjection\ContainerInterface' => new ServiceClosureArgument(new Reference('service_container')),
6058
];
61-
$this->assertEquals($expected, $container->getDefinition('test.private_services_locator')->getArgument(0));
62-
$this->assertSame($container, $container->get('test.private_services_locator')->get('Psr\Container\ContainerInterface'));
59+
60+
$privateServices = $container->getDefinition('test.private_services_locator')->getArgument(0);
61+
unset($privateServices['Symfony\Component\DependencyInjection\ContainerInterface'], $privateServices['Psr\Container\ContainerInterface']);
62+
63+
$this->assertEquals($expected, $privateServices);
6364
$this->assertFalse($container->getDefinition('Test\private_used_non_shared_service')->isShared());
6465
}
6566
}

‎src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,24 @@ public function testExceptionOnNonStringParameter()
410410

411411
public function testExceptionOnNonStringParameterWithSfContainer()
412412
{
413-
$this->expectException(RuntimeException::class);
414-
$this->expectExceptionMessage('The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type "stdClass".');
415413
$routes = new RouteCollection();
416414

417415
$routes->add('foo', new Route('/%object%'));
418416

419417
$sc = $this->getServiceContainer($routes);
420-
$sc->setParameter('object', new \stdClass());
421418

422-
$router = new Router($sc, 'foo');
419+
$pc = $this->createMock(ContainerInterface::class);
420+
$pc
421+
->expects($this->once())
422+
->method('get')
423+
->willReturn(new \stdClass())
424+
;
425+
426+
$router = new Router($sc, 'foo', [], null, $pc);
427+
428+
$this->expectException(RuntimeException::class);
429+
$this->expectExceptionMessage('The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type "stdClass".');
430+
423431
$router->getRouteCollection()->get('foo');
424432
}
425433

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.