Exemple #1
0
 public function logResult(PostExecute $event)
 {
     $this->requests[spl_object_hash($event->getQuery())] += ['result' => $event->getResult(), 'end' => microtime(TRUE)];
     $result = $event->getResult();
     $data = $event->getResult()->getData();
     $this->totalTime += isset($data['responseHeader']['QTime']) ? $data['responseHeader']['QTime'] : 0;
     if ($result instanceof SelectResult && $result->getDebug()->getTiming() !== NULL) {
         $this->totalTime -= $result->getDebug()->getTiming()->getPhase('process')->getTiming('debug');
     }
 }
Exemple #2
0
 public function testConstructorAndGetters()
 {
     $client = new Client();
     $query = $client->createSelect();
     $query->setQuery('test123');
     $response = new Response('', array('HTTP 1.0 200 OK'));
     $result = new Result($client, $query, $response);
     $event = new PostExecute($query, $result);
     $this->assertEquals($query, $event->getQuery());
     $this->assertEquals($result, $event->getResult());
 }