123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace Symfony\Component\EventDispatcher\Tests;
- use Symfony\Component\EventDispatcher\Event;
- use Symfony\Component\EventDispatcher\EventDispatcher;
- use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
- use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
- class LegacyEventDispatcherTest extends EventDispatcherTest
- {
-
- public function testLegacySignatureWithoutEvent()
- {
- $this->createEventDispatcher()->dispatch('foo');
- }
-
- public function testLegacySignatureWithEvent()
- {
- $this->createEventDispatcher()->dispatch('foo', new Event());
- }
-
- public function testLegacySignatureWithNewEventObject()
- {
- $this->createEventDispatcher()->dispatch('foo', new ContractsEvent());
- }
- protected function createEventDispatcher()
- {
- return LegacyEventDispatcherProxy::decorate(new TestLegacyEventDispatcher());
- }
- }
- class TestLegacyEventDispatcher extends EventDispatcher
- {
- public function dispatch($eventName, Event $event = null)
- {
- return parent::dispatch($event, $eventName);
- }
- }
|