Skip to content

Commit

Permalink
Merge 34df718 into 377f04d
Browse files Browse the repository at this point in the history
  • Loading branch information
jspaetzel committed Sep 1, 2020
2 parents 377f04d + 34df718 commit 99f7cd9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3

matrix:
include:
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -26,15 +26,15 @@
},
"require": {
"php": ">=5.6",
"robrichards/xmlseclibs": "~2.0|~3.0|~4.0",
"symfony/http-foundation": "~2.3|~3.0|~4.0",
"symfony/event-dispatcher": "~2.3|~3.0|~4.0"
"robrichards/xmlseclibs": "~2.0|~3.0",
"symfony/http-foundation": "~2.3|~3.0|~4.0|~5.0",
"symfony/event-dispatcher": "~2.3|~3.0|~4.0|~5.0"
},
"require-dev": {
"symfony/dom-crawler": "~2.3|~3.0|~4.0",
"symfony/css-selector": "~2.3|~3.0|~4.0",
"symfony/dom-crawler": "~2.3|~3.0|~4.0|~5.0",
"symfony/css-selector": "~2.3|~3.0|~4.0|~5.0",
"pimple/pimple": "~3.0",
"phpunit/phpunit": ">=5.7",
"phpunit/phpunit": ">=5.7 <8.0",
"monolog/monolog": "~1.3"
},
"suggest": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Expand Up @@ -10,12 +10,11 @@
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "autoload.php"
>

<logging>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
<log type="junit" target="build/logs/junit.xml"/>
</logging>

<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Action/DispatchEventAction.php
Expand Up @@ -40,6 +40,6 @@ public function __construct(EventDispatcherInterface $eventDispatcher, $event)
*/
public function execute(ContextInterface $context)
{
$this->eventDispatcher->dispatch($this->event, new GenericEvent($context));
$this->eventDispatcher->dispatch(new GenericEvent($context), $this->event);
}
}
4 changes: 2 additions & 2 deletions src/LightSaml/Binding/AbstractBinding.php
Expand Up @@ -48,7 +48,7 @@ public function getEventDispatcher()
protected function dispatchReceive($messageString)
{
if ($this->eventDispatcher) {
$this->eventDispatcher->dispatch(Events::BINDING_MESSAGE_RECEIVED, new GenericEvent($messageString));
$this->eventDispatcher->dispatch(new GenericEvent($messageString), Events::BINDING_MESSAGE_RECEIVED);
}
}

Expand All @@ -58,7 +58,7 @@ protected function dispatchReceive($messageString)
protected function dispatchSend($messageString)
{
if ($this->eventDispatcher) {
$this->eventDispatcher->dispatch(Events::BINDING_MESSAGE_SENT, new GenericEvent($messageString));
$this->eventDispatcher->dispatch(new GenericEvent($messageString), Events::BINDING_MESSAGE_SENT);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/LightSaml/Tests/Action/DispatchEventActionTest.php
Expand Up @@ -33,8 +33,8 @@ public function test_dispatches_generic_event_on_execute()
$eventDispatcherMock->expects($this->once())
->method('dispatch')
->with(
$this->equalTo($expectedEventName),
$this->isInstanceOf(GenericEvent::class)
$this->isInstanceOf(GenericEvent::class),
$this->equalTo($expectedEventName)
);

$action->execute($context);
Expand Down
Expand Up @@ -29,12 +29,13 @@ public function test_send_authn_request()
$eventDispatcherMock = $this->getEventDispatcherMock();
$eventDispatcherMock->expects($this->once())
->method('dispatch')
->willReturnCallback(function ($name, GenericEvent $event) {
->willReturnCallback(function (GenericEvent $event, $name) {
$this->assertEquals(Events::BINDING_MESSAGE_SENT, $name);
$this->assertNotEmpty($event->getSubject());
$doc = new \DOMDocument();
$doc->loadXML($event->getSubject());
$this->assertEquals('AuthnRequest', $doc->firstChild->localName);
return $event;
});

$biding->setEventDispatcher($eventDispatcherMock);
Expand Down Expand Up @@ -99,12 +100,13 @@ public function test_receive_authn_request()
$eventDispatcherMock = $this->getEventDispatcherMock();
$eventDispatcherMock->expects($this->once())
->method('dispatch')
->willReturnCallback(function ($name, GenericEvent $event) {
->willReturnCallback(function (GenericEvent $event, $name) {
$this->assertEquals(Events::BINDING_MESSAGE_RECEIVED, $name);
$this->assertNotEmpty($event->getSubject());
$doc = new \DOMDocument();
$doc->loadXML($event->getSubject());
$this->assertEquals('AuthnRequest', $doc->firstChild->localName);
return $event;
});

$binding->setEventDispatcher($eventDispatcherMock);
Expand Down
Expand Up @@ -32,12 +32,13 @@ public function test__send_authn_request()
$eventDispatcherMock = $this->getEventDispatcherMock();
$eventDispatcherMock->expects($this->once())
->method('dispatch')
->willReturnCallback(function ($name, GenericEvent $event) {
->willReturnCallback(function (GenericEvent $event, $name) {
$this->assertEquals(Events::BINDING_MESSAGE_SENT, $name);
$this->assertNotEmpty($event->getSubject());
$doc = new \DOMDocument();
$doc->loadXML($event->getSubject());
$this->assertEquals('AuthnRequest', $doc->firstChild->localName);
return $event;
});

$biding->setEventDispatcher($eventDispatcherMock);
Expand Down Expand Up @@ -122,12 +123,13 @@ public function test__receive_authn_request()
$eventDispatcherMock = $this->getEventDispatcherMock();
$eventDispatcherMock->expects($this->once())
->method('dispatch')
->willReturnCallback(function ($name, GenericEvent $event) {
->willReturnCallback(function (GenericEvent $event, $name) {
$this->assertEquals(Events::BINDING_MESSAGE_RECEIVED, $name);
$this->assertNotEmpty($event->getSubject());
$doc = new \DOMDocument();
$doc->loadXML($event->getSubject());
$this->assertEquals('AuthnRequest', $doc->firstChild->localName);
return $event;
});

$binding->setEventDispatcher($eventDispatcherMock);
Expand Down

0 comments on commit 99f7cd9

Please sign in to comment.