Пример #1
0
 public function testSetMessage()
 {
     $resultItem = new ResultItem('http://mysite.com/');
     $resultItem->setMessage('ok');
     $this->assertEquals('ok', $resultItem->getMessage());
 }
Пример #2
0
 /**
  * Process a list of items.
  *
  * @param array $items List of items.
  */
 protected function processItems(array $items)
 {
     $this->impotedItems = [];
     $this->resourceItems = [];
     $this->postAndPageItems = [];
     foreach ($items as $item) {
         try {
             $this->processItem($item);
         } catch (\Exception $e) {
             $resultItem = new ResultItem($item->getPermalink());
             $resultItem->setHasError(true);
             $resultItem->setMessage($e->getMessage());
             $this->impotedItems[] = $resultItem;
         }
     }
     if ($this->replaceUrls == true) {
         $this->replaceSourceUrlsPostAndPages();
     }
     foreach ($this->impotedItems as $resultItem) {
         $this->dumpResultItem($resultItem);
     }
 }