You are here

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

File

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

Class

PhpDumperTest

Namespace

Symfony\Component\DependencyInjection\Tests\Dumper

Code

public function testDumpRelativeDir() {
  $definition = new Definition();
  $definition
    ->setClass('stdClass');
  $definition
    ->addArgument('%foo%');
  $definition
    ->addArgument(array(
    '%foo%' => '%buz%/',
  ));
  $container = new ContainerBuilder();
  $container
    ->setDefinition('test', $definition);
  $container
    ->setParameter('foo', 'wiz' . dirname(__DIR__));
  $container
    ->setParameter('bar', __DIR__);
  $container
    ->setParameter('baz', '%bar%/PhpDumperTest.php');
  $container
    ->setParameter('buz', dirname(dirname(__DIR__)));
  $container
    ->compile();
  $dumper = new PhpDumper($container);
  $this
    ->assertStringEqualsFile(self::$fixturesPath . '/php/services12.php', $dumper
    ->dump(array(
    'file' => __FILE__,
  )), '->dump() dumps __DIR__ relative strings');
}