Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
conferinta_tbf
/
vendor
/
symfony
/
event-dispatcher
/
Tests
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
LegacyEventDispatcherTest.php
| Size :
2.65
KB
Copy
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ 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; /** * @group legacy */ class LegacyEventDispatcherTest extends EventDispatcherTest { /** * @group legacy * @expectedDeprecation The signature of the "Symfony\Component\EventDispatcher\Tests\TestLegacyEventDispatcher::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3. * @expectedDeprecation Calling the "Symfony\Contracts\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead. */ public function testLegacySignatureWithoutEvent() { $this->createEventDispatcher()->dispatch('foo'); } /** * @group legacy * @expectedDeprecation The signature of the "Symfony\Component\EventDispatcher\Tests\TestLegacyEventDispatcher::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3. * @expectedDeprecation Calling the "Symfony\Contracts\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead. */ public function testLegacySignatureWithEvent() { $this->createEventDispatcher()->dispatch('foo', new Event()); } public function testLegacySignatureWithNewEventObject() { $this->expectException('TypeError'); $this->expectExceptionMessage('Argument 1 passed to "Symfony\Contracts\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given.'); $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); } }
Back