aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-17 07:40:56 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-17 07:40:56 +0200
commit59b97fae996d8307b9d957d210d46200f6d206bf (patch)
tree9481859d10fafed91067ac7736480e91cd6eb4bb /tests
parentfbb319f064e6336a3b44bda12cdc51c93c51f379 (diff)
downloadwallabag-59b97fae996d8307b9d957d210d46200f6d206bf.tar.gz
wallabag-59b97fae996d8307b9d957d210d46200f6d206bf.tar.zst
wallabag-59b97fae996d8307b9d957d210d46200f6d206bf.zip
Avoid losing entry when fetching fail
Instead of just say “Failed to save entry” we’ll save the entry at all cost and try to fetch content. If fetching content failed, the entry will still be saved at least, but without content.
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/ImportBundle/Import/PocketImportTest.php4
-rw-r--r--tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
index 48fbbfb6..952521a2 100644
--- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
@@ -566,6 +566,8 @@ JSON;
566 "status": 1, 566 "status": 1,
567 "list": { 567 "list": {
568 "229279689": { 568 "229279689": {
569 "status": "1",
570 "favorite": "1",
569 "resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview" 571 "resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview"
570 } 572 }
571 } 573 }
@@ -603,6 +605,6 @@ JSON;
603 $res = $pocketImport->import(); 605 $res = $pocketImport->import();
604 606
605 $this->assertTrue($res); 607 $this->assertTrue($res);
606 $this->assertEquals(['skipped' => 1, 'imported' => 0, 'queued' => 0], $pocketImport->getSummary()); 608 $this->assertEquals(['skipped' => 0, 'imported' => 1, 'queued' => 0], $pocketImport->getSummary());
607 } 609 }
608} 610}
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
index b4017f72..12bd6bdd 100644
--- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
@@ -256,6 +256,6 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
256 $res = $wallabagV2Import->import(); 256 $res = $wallabagV2Import->import();
257 257
258 $this->assertTrue($res); 258 $this->assertTrue($res);
259 $this->assertEquals(['skipped' => 24, 'imported' => 0, 'queued' => 0], $wallabagV2Import->getSummary()); 259 $this->assertEquals(['skipped' => 22, 'imported' => 2, 'queued' => 0], $wallabagV2Import->getSummary());
260 } 260 }
261} 261}