You are here

public function ContainerBuilderTest::testCreateServiceMethodCalls in Zircon Profile 8

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

@covers Symfony\Component\DependencyInjection\ContainerBuilder::createService

File

vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php, line 378

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testCreateServiceMethodCalls() {
  $builder = new ContainerBuilder();
  $builder
    ->register('bar', 'stdClass');
  $builder
    ->register('foo1', 'Bar\\FooClass')
    ->addMethodCall('setBar', array(
    array(
      '%value%',
      new Reference('bar'),
    ),
  ));
  $builder
    ->setParameter('value', 'bar');
  $this
    ->assertEquals(array(
    'bar',
    $builder
      ->get('bar'),
  ), $builder
    ->get('foo1')->bar, '->createService() replaces the values in the method calls arguments');
}