Skip to content

Commit

Permalink
fix import with invalid guid_hash
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <[email protected]>
  • Loading branch information
Grotax authored and SMillerDev committed Aug 29, 2020
1 parent 7d96630 commit dd266ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Db/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function fromImport($import): Item
{
$item = new Item();
$item->setGuid($import['guid']);
$item->setGuidHash($import['guid']);
$item->setGuidHash(md5($import['guid']));
$item->setUrl($import['url']);
$item->setTitle($import['title']);
$item->setAuthor($import['author']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Db/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private function createImportItem($isRead)
{
$item = new Item();
$item->setGuid('guid');
$item->setGuidHash('guid');
$item->setGuidHash('1e0ca5b1252f1f6b1e0ac91be7e7219e');
$item->setUrl('https://google');
$item->setTitle('title');
$item->setAuthor('author');
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Service/FeedServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public function testImportArticles()
$item->setFeedId(3);
$item->setAuthor('john');
$item->setGuid('s');
$item->setGuidHash('s');
$item->setGuidHash('03c7c0ace395d80182db07ae2c30f034');
$item->setTitle('hey');
$item->setPubDate(333);
$item->setBody('come over');
Expand Down Expand Up @@ -910,7 +910,7 @@ public function testImportArticlesCreatesOwnFeedWhenNotFound()
$item->setFeedId(3);
$item->setAuthor('john');
$item->setGuid('s');
$item->setGuidHash('s');
$item->setGuidHash('03c7c0ace395d80182db07ae2c30f034');
$item->setTitle('hey');
$item->setPubDate(333);
$item->setBody('come over');
Expand Down

0 comments on commit dd266ed

Please sign in to comment.