public function RegisterListenersPassTest::testValidEventSubscriber in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php \Symfony\Component\EventDispatcher\Tests\DependencyInjection\RegisterListenersPassTest::testValidEventSubscriber()
File
- vendor/
symfony/ event-dispatcher/ Tests/ DependencyInjection/ RegisterListenersPassTest.php, line 61
Class
Namespace
Symfony\Component\EventDispatcher\Tests\DependencyInjectionCode
public function testValidEventSubscriber() {
$services = array(
'my_event_subscriber' => array(
0 => array(),
),
);
$definition = $this
->getMock('Symfony\\Component\\DependencyInjection\\Definition');
$definition
->expects($this
->atLeastOnce())
->method('isPublic')
->will($this
->returnValue(true));
$definition
->expects($this
->atLeastOnce())
->method('getClass')
->will($this
->returnValue('Symfony\\Component\\EventDispatcher\\Tests\\DependencyInjection\\SubscriberService'));
$builder = $this
->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder', array(
'hasDefinition',
'findTaggedServiceIds',
'getDefinition',
'findDefinition',
));
$builder
->expects($this
->any())
->method('hasDefinition')
->will($this
->returnValue(true));
// We don't test kernel.event_listener here
$builder
->expects($this
->atLeastOnce())
->method('findTaggedServiceIds')
->will($this
->onConsecutiveCalls(array(), $services));
$builder
->expects($this
->atLeastOnce())
->method('getDefinition')
->will($this
->returnValue($definition));
$builder
->expects($this
->atLeastOnce())
->method('findDefinition')
->will($this
->returnValue($definition));
$registerListenersPass = new RegisterListenersPass();
$registerListenersPass
->process($builder);
}