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); }
/** * @dataProvider ignoreTransactionProvider */ public function testIgnoreTransaction($transactions, $executed) { if ($executed) { $this->client->expects($this->once())->method('ignoreTransaction'); } else { $this->client->expects($this->never())->method('ignoreTransaction'); } $listener = $this->getListener($transactions); $event = $this->getEvent(); $listener->onRequest($event); }
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); }
public function testShouldNotSetBackgroundJobWhenHttpRequest() { $this->client->expects($this->never())->method('backgroundJob'); $event = $this->getEvent(); $event->setRequest(new HttpRequest()); $this->getListener()->onRequest($event); }