public function test_main_shouldReturnErrorResponse_InCaseOfAnyError() { $requestSet = new RequestSet(); $requestSet->enableThrowExceptionOnInit(); $handler = $this->getHandler(); $handler->setResponse(new Response()); $response = $this->tracker->main($handler, $requestSet); $this->assertSame('{"status":"error","tracked":0,"invalid":0}', $response); }
public function test_main_shouldReturnResponse_EvenWhenThereWasAnExceptionDuringInitRequests() { $this->requestSet->enableThrowExceptionOnInit(); $response = $this->tracker->main($this->handler, $this->requestSet); $this->assertEquals('Init requests and token auth exception', $response); }