Exemplo n.º 1
0
 public function testAppNameNotSetWhenMissingInConfig()
 {
     $this->moduleOptions->setApplicationName('');
     $this->client->expects($this->never())->method('setAppName');
     $routeMatch = class_exists(RouteMatch::class) ? new RouteMatch([]) : new RouteMatchV2([]);
     $this->event->setRouteMatch($routeMatch);
     $this->listener->onRequest($this->event);
 }
 public function testAppNameNotSetWhenMissingInConfig()
 {
     $this->moduleOptions->setApplicationName("");
     $this->client->expects($this->never())->method('setAppName');
     $routeMatch = new \Zend\Mvc\Router\RouteMatch(array());
     $this->event->setRouteMatch($routeMatch);
     $this->listener->onRequest($this->event);
 }
Exemplo n.º 3
0
 public function testOnResponseInAjaxHttpRequestContext()
 {
     $this->moduleOptions->setBrowserTimingEnabled(true);
     $this->client->expects($this->once())->method('disableAutorum');
     $this->client->expects($this->never())->method('getBrowserTimingHeader');
     $this->client->expects($this->never())->method('getBrowserTimingFooter');
     $request = $this->createMock(HttpRequest::class);
     $request->expects($this->once())->method('isXmlHttpRequest')->will($this->returnValue(true));
     $this->event->setRequest($request);
     $this->listener->onResponse($this->event);
 }
Exemplo n.º 4
0
 public function testSetListeners()
 {
     $this->moduleOptions->setListeners(['foo', 'bar', 'baz']);
     $listeners = $this->moduleOptions->getListeners();
     $this->assertCount(3, $listeners);
 }