public function DefinitionDecoratorTest::testReplaceArgument in Zircon Profile 8
Same name and namespace in other branches
- 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
Namespace
Symfony\Component\DependencyInjection\TestsCode
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());
}