protected function createTestRouter()
{
$this->assertNull($this->router);
$this->router = new Router(\EventLoop\getLoop());
// create a client that records all publish events
$this->recordedEvents = [];
$this->eventClient = new Client("test_realm", \EventLoop\getLoop());
$this->eventClient->on('open', function (ClientSession $session) {
$session->subscribe("wamppost.tests.", function ($args, $argsKw, $details, $pubId) {
$eventMessage = new EventMessage(0, $pubId, $details, $args, $argsKw, $details->topic);
array_push($this->recordedEvents, $eventMessage);
}, (object) ["match" => "prefix"]);
});
$this->router->addInternalClient($this->eventClient);
return $this->router;
}