Skip to content

Commit

Permalink
use the 2.4 symfony dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Oct 25, 2016
1 parent 7e77aee commit 7ca3121
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 5 additions & 6 deletions tests/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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);
}
}

}
}

0 comments on commit 7ca3121

Please sign in to comment.