public function testOnRequestGivenHttpRequestAndNotMatchedTransactionShouldNotSetBackgroundJob() { $moduleOptions = $this->createMock(ModuleOptionsInterface::class); $event = $this->getEvent(); $event->setRequest(new HttpRequest()); $transactionMatcher = $this->getTransactionMatcherMock(); $transactionMatcher->method('isMatched')->will($this->returnValue(false)); $client = $this->getClientMock(); $client->expects($this->never())->method('backgroundJob'); $listener = new BackgroundJobListener($client, $moduleOptions, $transactionMatcher); $listener->onRequest($event); }
/** * @param array $transactions * @return BackgroundJobListener */ protected function getListener($transactions = array()) { $listener = new BackgroundJobListener($transactions); $listener->setClient($this->client); return $listener; }