public function test_outputResponse_shouldOutputInvalidRequests_IfInvalidCountSet()
 {
     $tracker = $this->getTrackerWithCountedRequests();
     $this->response->setInvalidCount(3);
     $this->response->outputResponse($tracker);
     $content = $this->response->getOutput();
     $this->assertEquals('{"status":"success","tracked":5,"invalid":3}', $content);
 }
Esempio n. 2
0
 public function test_outputResponse_shouldOutputInvalidRequests_IfInvalidIndicesSet_AndRequestAuthenticated()
 {
     $tracker = $this->getTrackerWithCountedRequests();
     $this->response->setInvalidRequests(array(5, 63, 72));
     $this->response->setIsAuthenticated(true);
     $this->response->outputResponse($tracker);
     $content = $this->response->getOutput();
     $this->assertEquals('{"status":"success","tracked":5,"invalid":3,"invalid_indices":[5,63,72]}', $content);
 }