You are here

public function PhpDumperTest::testDump 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::testDump()

File

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

Class

PhpDumperTest

Namespace

Symfony\Component\DependencyInjection\Tests\Dumper

Code

public function testDump() {
  $dumper = new PhpDumper($container = new ContainerBuilder());
  $this
    ->assertStringEqualsFile(self::$fixturesPath . '/php/services1.php', $dumper
    ->dump(), '->dump() dumps an empty container as an empty PHP class');
  $this
    ->assertStringEqualsFile(self::$fixturesPath . '/php/services1-1.php', $dumper
    ->dump(array(
    'class' => 'Container',
    'base_class' => 'AbstractContainer',
    'namespace' => 'Symfony\\Component\\DependencyInjection\\Dump',
  )), '->dump() takes a class and a base_class options');
  $container = new ContainerBuilder();
  new PhpDumper($container);
}