You are here

private function ResolveParameterPlaceHoldersPassTest::createContainerBuilder in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\ResolveParameterPlaceHoldersPassTest::createContainerBuilder()
1 call to ResolveParameterPlaceHoldersPassTest::createContainerBuilder()
ResolveParameterPlaceHoldersPassTest::setUp in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php, line 66

Class

ResolveParameterPlaceHoldersPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

private function createContainerBuilder() {
  $containerBuilder = new ContainerBuilder();
  $containerBuilder
    ->setParameter('foo.class', 'Foo');
  $containerBuilder
    ->setParameter('foo.factory.class', 'FooFactory');
  $containerBuilder
    ->setParameter('foo.arg1', 'bar');
  $containerBuilder
    ->setParameter('foo.arg2', 'baz');
  $containerBuilder
    ->setParameter('foo.method', 'foobar');
  $containerBuilder
    ->setParameter('foo.property.name', 'bar');
  $containerBuilder
    ->setParameter('foo.property.value', 'baz');
  $containerBuilder
    ->setParameter('foo.file', 'foo.php');
  $containerBuilder
    ->setParameter('alias.id', 'bar');
  $fooDefinition = $containerBuilder
    ->register('foo', '%foo.class%');
  $fooDefinition
    ->setFactory(array(
    '%foo.factory.class%',
    'getFoo',
  ));
  $fooDefinition
    ->setArguments(array(
    '%foo.arg1%',
    '%foo.arg2%',
  ));
  $fooDefinition
    ->addMethodCall('%foo.method%', array(
    '%foo.arg1%',
    '%foo.arg2%',
  ));
  $fooDefinition
    ->setProperty('%foo.property.name%', '%foo.property.value%');
  $fooDefinition
    ->setFile('%foo.file%');
  $containerBuilder
    ->setAlias('%alias.id%', 'foo');
  return $containerBuilder;
}