You are here

public function PhpDumperTest::testOverrideServiceWhenUsingADumpedContainer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testOverrideServiceWhenUsingADumpedContainer()

File

vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php, line 183

Class

PhpDumperTest

Namespace

Symfony\Component\DependencyInjection\Tests\Dumper

Code

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');
}