You are here

public function PhpDumperTest::testAliases in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testAliases()

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php, line 159

Class

PhpDumperTest

Namespace

Symfony\Component\DependencyInjection\Tests\Dumper

Code

public function testAliases() {
  $container = (include self::$fixturesPath . '/containers/container9.php');
  $container
    ->compile();
  $dumper = new PhpDumper($container);
  eval('?>' . $dumper
    ->dump(array(
    'class' => 'Symfony_DI_PhpDumper_Test_Aliases',
  )));
  $container = new \Symfony_DI_PhpDumper_Test_Aliases();
  $container
    ->set('foo', $foo = new \stdClass());
  $this
    ->assertSame($foo, $container
    ->get('foo'));
  $this
    ->assertSame($foo, $container
    ->get('alias_for_foo'));
  $this
    ->assertSame($foo, $container
    ->get('alias_for_alias'));
}