diff options
-rw-r--r-- | src/Wallabag/ImportBundle/Import/PocketImport.php | 6 | ||||
-rw-r--r-- | tests/Wallabag/ImportBundle/Import/PocketImportTest.php | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index a9b43993..5737928d 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php | |||
@@ -206,10 +206,10 @@ class PocketImport extends AbstractImport | |||
206 | $this->fetchContent($entry, $url); | 206 | $this->fetchContent($entry, $url); |
207 | 207 | ||
208 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted | 208 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted |
209 | $entry->setArchived(1 == $importedEntry['status'] || $this->markAsRead); | 209 | $entry->setArchived(1 === (int) $importedEntry['status'] || $this->markAsRead); |
210 | 210 | ||
211 | // 0 or 1 - 1 If the item is starred | 211 | // 0 or 1 - 1 if the item is starred |
212 | $entry->setStarred(1 == $importedEntry['favorite']); | 212 | $entry->setStarred(1 === (int) $importedEntry['favorite']); |
213 | 213 | ||
214 | $title = 'Untitled'; | 214 | $title = 'Untitled'; |
215 | if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) { | 215 | if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) { |
diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php index baa5d905..8083f1a8 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php | |||
@@ -226,6 +226,13 @@ class PocketImportTest extends TestCase | |||
226 | ->method('getRepository') | 226 | ->method('getRepository') |
227 | ->willReturn($entryRepo); | 227 | ->willReturn($entryRepo); |
228 | 228 | ||
229 | $this->em | ||
230 | ->expects($this->any()) | ||
231 | ->method('persist') | ||
232 | ->with($this->callback(function ($persistedEntry) { | ||
233 | return $persistedEntry->isArchived() && $persistedEntry->isStarred(); | ||
234 | })); | ||
235 | |||
229 | $entry = new Entry($this->user); | 236 | $entry = new Entry($this->user); |
230 | 237 | ||
231 | $this->contentProxy | 238 | $this->contentProxy |