public function test_process_ShouldTrackAllSetRequests()
 {
     $this->assertSame(0, $this->tracker->getCountOfLoggedRequests());
     $this->requestSet->setRequests(array(array('idsite' => 1, 'url' => 'http://localhost/foo?bar'), array('idsite' => 1, 'url' => 'http://localhost')));
     $this->handler->process($this->tracker, $this->requestSet);
     $this->assertSame(2, $this->tracker->getCountOfLoggedRequests());
 }
Beispiel #2
0
 public function track(Handler $handler, RequestSet $requestSet)
 {
     if (!$this->shouldRecordStatistics()) {
         return;
     }
     $requestSet->initRequestsAndTokenAuth();
     if ($requestSet->hasRequests()) {
         $handler->onStartTrackRequests($this, $requestSet);
         $handler->process($this, $requestSet);
         $handler->onAllRequestsTracked($this, $requestSet);
     }
 }