public function PhpDumperTest::testOverrideServiceWhenUsingADumpedContainer in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testOverrideServiceWhenUsingADumpedContainer()
 
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Dumper/ PhpDumperTest.php, line 185  
Class
Namespace
Symfony\Component\DependencyInjection\Tests\DumperCode
public function testOverrideServiceWhenUsingADumpedContainer() {
  require_once self::$fixturesPath . '/php/services9.php';
  require_once self::$fixturesPath . '/includes/foo.php';
  $container = new \ProjectServiceContainer();
  $container
    ->set('bar', $bar = new \stdClass());
  $container
    ->setParameter('foo_bar', 'foo_bar');
  $this
    ->assertEquals($bar, $container
    ->get('bar'), '->set() overrides an already defined service');
}