aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-03-04 10:04:51 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-03-04 10:04:51 +0100
commit79d0e38e7ff975b2e0306d3dd96f57509fd84aef (patch)
treea359ef1a392865e7d41f3f927594d1480ebe1df8 /src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
parentc32ae320fec4135f5b32d57ef88349317a3b1f3f (diff)
downloadwallabag-79d0e38e7ff975b2e0306d3dd96f57509fd84aef.tar.gz
wallabag-79d0e38e7ff975b2e0306d3dd96f57509fd84aef.tar.zst
wallabag-79d0e38e7ff975b2e0306d3dd96f57509fd84aef.zip
Adding test
Reformat json file (thanks pro.jsonlint.com)
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php')
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
index 8728364b..c461168c 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
@@ -90,15 +90,18 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
90 ->method('getRepository') 90 ->method('getRepository')
91 ->willReturn($entryRepo); 91 ->willReturn($entryRepo);
92 92
93 // check that every entry persisted are archived
94 $this->em
95 ->expects($this->any())
96 ->method('persist')
97 ->with($this->callback(function($persistedEntry) {
98 return $persistedEntry->isArchived();
99 }));
100
93 $res = $wallabagV2Import->setMarkAsRead(true)->import(); 101 $res = $wallabagV2Import->setMarkAsRead(true)->import();
94 102
95 $this->assertTrue($res); 103 $this->assertTrue($res);
96 104
97 $this->em
98 ->expects($this->any())
99 ->method('getBuilderForArchiveByUser')
100 ->willReturn($entryRepo);
101
102 $this->assertEquals(['skipped' => 0, 'imported' => 2], $wallabagV2Import->getSummary()); 105 $this->assertEquals(['skipped' => 0, 'imported' => 2], $wallabagV2Import->getSummary());
103 } 106 }
104 107