eZ\Bundle\EzPublishCoreBundle\Tests\DependencyInjection\Compiler\SignalSlotPassTest::testProcess PHP Method

testProcess() public method

public testProcess ( )
    public function testProcess()
    {
        $dispatcherDef = new Definition();
        $slotDef = new Definition();
        $signalIdentifier = 'FooSignal';
        $slotDef->addTag('ezpublish.api.slot', array('signal' => $signalIdentifier));
        $containerBuilder = new ContainerBuilder();
        $slotId = 'acme.foo_slot';
        $containerBuilder->addDefinitions(array($slotId => $slotDef, 'ezpublish.signalslot.signal_dispatcher' => $dispatcherDef));
        $pass = new SignalSlotPass();
        $pass->process($containerBuilder);
        $this->assertTrue($dispatcherDef->hasMethodCall('attach'));
        $calls = $dispatcherDef->getMethodCalls();
        list($method, $arguments) = $calls[0];
        $this->assertSame('attach', $method);
        list($signal, $serviceId) = $arguments;
        $this->assertSame($signalIdentifier, $signal);
        $this->assertEquals($slotId, new Reference($serviceId));
    }