You are here

public function DefinitionTest::testArguments in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php \Symfony\Component\DependencyInjection\Tests\DefinitionTest::testArguments()

@covers Symfony\Component\DependencyInjection\Definition::setArguments @covers Symfony\Component\DependencyInjection\Definition::getArguments @covers Symfony\Component\DependencyInjection\Definition::addArgument

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php, line 81

Class

DefinitionTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testArguments() {
  $def = new Definition('stdClass');
  $this
    ->assertSame($def, $def
    ->setArguments(array(
    'foo',
  )), '->setArguments() implements a fluent interface');
  $this
    ->assertEquals(array(
    'foo',
  ), $def
    ->getArguments(), '->getArguments() returns the arguments');
  $this
    ->assertSame($def, $def
    ->addArgument('bar'), '->addArgument() implements a fluent interface');
  $this
    ->assertEquals(array(
    'foo',
    'bar',
  ), $def
    ->getArguments(), '->addArgument() adds an argument');
}