diff --git a/module/EventDispatcher/test/Async/TaskRunnerTest.php b/module/EventDispatcher/test/Async/TaskRunnerTest.php index a78a741b..0bf56d7c 100644 --- a/module/EventDispatcher/test/Async/TaskRunnerTest.php +++ b/module/EventDispatcher/test/Async/TaskRunnerTest.php @@ -21,7 +21,7 @@ class TaskRunnerTest extends TestCase private $logger; /** @var ObjectProphecy */ private $container; - /** @var ObjectProphecy */ + /** @var HttpServer */ private $server; /** @var ObjectProphecy */ private $task; diff --git a/module/EventDispatcher/test/Listener/AsyncEventListenerTest.php b/module/EventDispatcher/test/Listener/AsyncEventListenerTest.php new file mode 100644 index 00000000..554528cd --- /dev/null +++ b/module/EventDispatcher/test/Listener/AsyncEventListenerTest.php @@ -0,0 +1,41 @@ +regularListenerName = 'the_regular_listener'; + $this->server = $this->createMock(HttpServer::class); + + $this->eventListener = new AsyncEventListener($this->server, $this->regularListenerName); + } + + /** @test */ + public function enqueuesTaskWhenInvoked(): void + { + $event = new stdClass(); + + $this->server + ->expects($this->once()) + ->method('task') + ->with(new EventListenerTask($this->regularListenerName, $event)); + + ($this->eventListener)($event); + } +}