public function testFromImportRead() { $item = $this->createImportItem(true); $import = ['guid' => $item->getGuid(), 'url' => $item->getUrl(), 'title' => $item->getTitle(), 'author' => $item->getAuthor(), 'pubDate' => $item->getPubDate(), 'body' => $item->getBody(), 'enclosureMime' => $item->getEnclosureMime(), 'enclosureLink' => $item->getEnclosureLink(), 'unread' => $item->isUnread(), 'starred' => $item->isStarred(), 'rtl' => $item->getRtl()]; $compareWith = Item::fromImport($import); $this->assertEquals($item, $compareWith); }
public function testFromImport() { $item = new Item(); $item->setGuid('guid'); $item->setUrl('https://google'); $item->setTitle('title'); $item->setAuthor('author'); $item->setPubDate(123); $item->setBody('body'); $item->setEnclosureMime('audio/ogg'); $item->setEnclosureLink('enclink'); $item->setFeedId(1); $item->setUnread(); $item->setStarred(); $feed = new Feed(); $feed->setLink('http://test'); $feeds = array("feed1" => $feed); $compareWith = Item::fromImport($item->toExport($feeds)); $item->setFeedId(null); $this->assertEquals($item, $compareWith); }