diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php index 093420f9..9a563a11 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php | |||
@@ -57,19 +57,28 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
57 | ->disableOriginalConstructor() | 57 | ->disableOriginalConstructor() |
58 | ->getMock(); | 58 | ->getMock(); |
59 | 59 | ||
60 | $entryRepo->expects($this->exactly(3)) | 60 | $entryRepo->expects($this->exactly(4)) |
61 | ->method('findByUrlAndUserId') | 61 | ->method('findByUrlAndUserId') |
62 | ->will($this->onConsecutiveCalls(false, true, false)); | 62 | ->will($this->onConsecutiveCalls(false, true, false, false)); |
63 | 63 | ||
64 | $this->em | 64 | $this->em |
65 | ->expects($this->any()) | 65 | ->expects($this->any()) |
66 | ->method('getRepository') | 66 | ->method('getRepository') |
67 | ->willReturn($entryRepo); | 67 | ->willReturn($entryRepo); |
68 | 68 | ||
69 | $entry = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Entry') | ||
70 | ->disableOriginalConstructor() | ||
71 | ->getMock(); | ||
72 | |||
73 | $this->contentProxy | ||
74 | ->expects($this->once()) | ||
75 | ->method('updateEntry') | ||
76 | ->willReturn($entry); | ||
77 | |||
69 | $res = $wallabagV1Import->import(); | 78 | $res = $wallabagV1Import->import(); |
70 | 79 | ||
71 | $this->assertTrue($res); | 80 | $this->assertTrue($res); |
72 | $this->assertEquals(['skipped' => 1, 'imported' => 2], $wallabagV1Import->getSummary()); | 81 | $this->assertEquals(['skipped' => 1, 'imported' => 3], $wallabagV1Import->getSummary()); |
73 | } | 82 | } |
74 | 83 | ||
75 | public function testImportBadFile() | 84 | public function testImportBadFile() |