コード例 #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);
 }
コード例 #2
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);
 }
コード例 #3
0
 /**
  * @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);
 }
コード例 #4
0
 public function testShouldNotSetBackgroundJobWhenHttpRequest()
 {
     $this->client->expects($this->never())->method('backgroundJob');
     $event = $this->getEvent();
     $event->setRequest(new HttpRequest());
     $this->getListener()->onRequest($event);
 }
コード例 #5
0
ファイル: NewRelic.php プロジェクト: simplicity-ag/NewRelic
 /**
  * Write a message to NewRelic.
  *
  * @param  array $event event data
  * @return void
  */
 protected function doWrite(array $event)
 {
     $exception = isset($event['extra']['exception']) ? $event['extra']['exception'] : null;
     $this->client->noticeError($event['message'], $exception);
 }