From 7ca312187f620c667f6199ad73ec4ad0c7c4217d Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Tue, 25 Oct 2016 12:25:32 +0200 Subject: [PATCH] use the 2.4 symfony dispatcher --- composer.json | 2 +- tests/EventsTest.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 0b4b1f3..78ba684 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": "^5.4|^7.0", "goetas-webservices/xsd-reader": "^0.2", - "symfony/event-dispatcher" : "^2.2||^3.0" + "symfony/event-dispatcher" : "^2.4||^3.0" }, "require-dev" : { "phpunit/phpunit" : "^4.8|^5.0", diff --git a/tests/EventsTest.php b/tests/EventsTest.php index 7468c82..490c9ae 100644 --- a/tests/EventsTest.php +++ b/tests/EventsTest.php @@ -29,8 +29,8 @@ public function setUp() public function testReadFile() { $events = array(); - $this->dispatcher->addListener("#", function (Event $e) use (&$events) { - $events[] = $e; + $this->dispatcher->addListener("#", function (Event $e, $name) use (&$events) { + $events[] = [$e, $name]; }); $this->reader->readFile(__DIR__ . '/resources/base-wsdl-events.wsdl'); @@ -73,13 +73,12 @@ public function testReadFile() $this->assertCount(count($expected), $events); foreach ($expected as $index => $expectedData) { - $event = $events[$index]; - + list($event, $name) = $events[$index]; $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $event); $this->assertInstanceOf('GoetasWebservices\XML\WSDLReader\Events\WsdlEvent', $event); $this->assertInstanceOf($expectedData[1], $event, "Event name '$expectedData[0]'"); - $this->assertEquals($expectedData[0], $event->getName()); + $this->assertEquals($expectedData[0], $name); } } -} \ No newline at end of file +}