You are here

public function DefinitionDecoratorTest::testReplaceArgument in Zircon Profile 8

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

File

vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php, line 117

Class

DefinitionDecoratorTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testReplaceArgument() {
  $def = new DefinitionDecorator('foo');
  $def
    ->setArguments(array(
    0 => 'foo',
    1 => 'bar',
  ));
  $this
    ->assertEquals('foo', $def
    ->getArgument(0));
  $this
    ->assertEquals('bar', $def
    ->getArgument(1));
  $this
    ->assertSame($def, $def
    ->replaceArgument(1, 'baz'));
  $this
    ->assertEquals('foo', $def
    ->getArgument(0));
  $this
    ->assertEquals('baz', $def
    ->getArgument(1));
  $this
    ->assertEquals(array(
    0 => 'foo',
    1 => 'bar',
    'index_1' => 'baz',
  ), $def
    ->getArguments());
}