public function testMarkAsDone()
 {
     Injector::inst()->get('URLArrayObject')->addUrls(array('monkey' => 1), true);
     $url = StaticPagesQueue::get_next_url();
     $this->assertTrue(StaticPagesQueue::delete_by_link($url));
     #$this->assertNull( DataObject::get('StaticPagesQueue'));
 }
 /**
  *
  * @return boolean - if this task was run
  */
 protected function buildCache()
 {
     $this->updatePid();
     $this->load_error_handlers();
     $published = 0;
     while (self::$current_url = StaticPagesQueue::get_next_url()) {
         $this->updatePid();
         $prePublishTime = microtime(true);
         $results = $this->createCachedFiles(array(self::$current_url));
         if ($this->verbose) {
             foreach ($results as $url => $data) {
                 $this->printPublishingMetrics($published++, $prePublishTime, $url, sprintf('HTTP Status: %d', $results[$url]['statuscode']));
             }
         }
         $this->logSummary($published, false, $prePublishTime);
         StaticPagesQueue::delete_by_link(self::$current_url);
     }
     if ($published) {
         $this->logSummary($published, true, $prePublishTime);
     }
     return true;
 }