diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-04 10:04:51 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-04 10:04:51 +0100 |
commit | 79d0e38e7ff975b2e0306d3dd96f57509fd84aef (patch) | |
tree | a359ef1a392865e7d41f3f927594d1480ebe1df8 /src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | |
parent | c32ae320fec4135f5b32d57ef88349317a3b1f3f (diff) | |
download | wallabag-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.php | 13 |
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 | ||