Inheritance: implements Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface
Example #1
0
 public function testOnClose()
 {
     $context = $this->prophesize(MessageHandlerContext::class);
     $conn = $this->prophesize(ConnectionInterface::class);
     $handler1 = $this->prophesize(MessageHandlerInterface::class);
     $handler1->onClose($conn->reveal(), $context->reveal())->shouldBeCalled();
     $handler2 = $this->prophesize(MessageHandlerInterface::class);
     $handler2->onClose($conn->reveal(), $context->reveal())->shouldBeCalled();
     $dispatcher = new MessageDispatcher();
     $dispatcher->add('test-1', $handler1->reveal());
     $dispatcher->add('test-2', $handler2->reveal());
     $dispatcher->onClose($conn->reveal(), $context->reveal());
 }