コード例 #1
0
 /**
  * @param Symfony\Component\DependencyInjection\ContainerBuilder $container
  * @param Symfony\Component\DependencyInjection\Definition $manager
  * @param Symfony\Component\DependencyInjection\Definition $string
  * @param Symfony\Component\DependencyInjection\Definition $int
  * @param Symfony\Component\DependencyInjection\Definition $boolean
  **/
 function let($container, $manager, $string, $int, $boolean)
 {
     $services = ['friendly.guesser.string' => null, 'friendly.guesser.int' => null, 'friendly.guesser.boolean' => null];
     $stringFaker = ['friendly.faker.provider.address' => null, 'friendly.faker.provider.person' => null, 'friendly.faker.provider.internet' => null];
     $intFaker = ['friendly.faker.provider.payment' => null];
     $container->findTaggedServiceIds('friendly.format.guesser')->willReturn($services);
     $container->findTaggedServiceIds('friendly.guesser.string.faker')->willReturn($stringFaker);
     $container->findTaggedServiceIds('friendly.guesser.int.faker')->willReturn($intFaker);
     $container->findTaggedServiceIds('friendly.guesser.boolean.faker')->willReturn([]);
     $container->getDefinition('friendly.guesser.manager')->willReturn($manager);
     $container->getDefinition('friendly.guesser.string')->willReturn($string);
     $container->getDefinition('friendly.guesser.int')->willReturn($int);
     $container->getDefinition('friendly.guesser.boolean')->willReturn($boolean);
 }
コード例 #2
0
 /**
  * @param Symfony\Component\DependencyInjection\ContainerBuilder $container
  * @param Symfony\Component\DependencyInjection\Definition $dispatcherDefinition
  */
 public function it_processes_listeners($container, $dispatcherDefinition)
 {
     $container->hasDefinition('fabricius.dispatcher')->shouldBeCalled()->willReturn(true);
     $container->getDefinition('fabricius.dispatcher')->shouldBeCalled()->willReturn($dispatcherDefinition);
     $container->findTaggedServiceIds('fabricius.listener')->shouldBeCalled()->willReturn(array(array('test' => array('weight' => 10, 'event' => Events::CONTENT_PARSED))));
     $dispatcherDefinition->addMethodCall('addListener', Argument::any())->shouldBeCalled();
     $this->process($container);
 }
コード例 #3
0
 /**
  * @param Symfony\Component\DependencyInjection\ContainerBuilder $container
  * @param Symfony\Component\DependencyInjection\Definition $formatterDefinition
  */
 public function it_processes_format_handlers($container, $formatterDefinition)
 {
     $container->hasDefinition('fabricius.formatter')->shouldBeCalled()->willReturn(true);
     $container->getDefinition('fabricius.formatter')->shouldBeCalled()->willReturn($formatterDefinition);
     $container->findTaggedServiceIds('fabricius.formatter')->shouldBeCalled()->willReturn(array(array('test' => array())));
     $formatterDefinition->addMethodCall('addFormatHandler', Argument::any())->shouldBeCalled();
     $this->process($container);
 }
コード例 #4
0
 /**
  * @param Symfony\Component\DependencyInjection\ContainerBuilder $container
  * @param Symfony\Component\DependencyInjection\Definition $string
  * @param Symfony\Component\DependencyInjection\Definition $int
  * @param Symfony\Component\DependencyInjection\Definition $boolean
  **/
 function let($container, $string, $int, $boolean)
 {
     $services = ['friendly.faker.provider.string' => null, 'friendly.faker.provider.int' => null, 'friendly.faker.provider.boolean' => null];
     $container->findTaggedServiceIds('friendly.faker.provider')->willReturn($services);
     $container->getDefinition('friendly.faker.provider.string')->willReturn($string);
     $container->getDefinition('friendly.faker.provider.int')->willReturn($int);
     $container->getDefinition('friendly.faker.provider.boolean')->willReturn($boolean);
 }