Example #1
0
 public function __construct(SpiderStatus $status = null)
 {
     if ($status) {
         $json = array('empty' => false, 'current' => $status->getCurrent(), 'visited' => $status->getVisited(), 'gathered' => $status->getGathered(), 'elapsed' => $status->getElapsedTime(), 'finished' => $status->isFinished());
     } else {
         $json = array('empty' => true);
     }
     parent::__construct($json);
 }
 /**
  * @dataProvider providerGetElapsedTime
  */
 public function testGetElapsedTime($expected, $start, $stop)
 {
     $status = new SpiderStatus(null, 0, 0, $start, $stop);
     $result = $status->getElapsedTime();
     $this->assertEquals($expected, $result);
 }