diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import')
-rw-r--r-- | src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php | 15 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | 4 |
2 files changed, 14 insertions, 5 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() |
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php index ebabb8f7..3268cd3e 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | |||
@@ -57,7 +57,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase | |||
57 | ->disableOriginalConstructor() | 57 | ->disableOriginalConstructor() |
58 | ->getMock(); | 58 | ->getMock(); |
59 | 59 | ||
60 | $entryRepo->expects($this->exactly(2)) | 60 | $entryRepo->expects($this->exactly(3)) |
61 | ->method('findByUrlAndUserId') | 61 | ->method('findByUrlAndUserId') |
62 | ->will($this->onConsecutiveCalls(false, true, false)); | 62 | ->will($this->onConsecutiveCalls(false, true, false)); |
63 | 63 | ||
@@ -69,7 +69,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase | |||
69 | $res = $wallabagV2Import->import(); | 69 | $res = $wallabagV2Import->import(); |
70 | 70 | ||
71 | $this->assertTrue($res); | 71 | $this->assertTrue($res); |
72 | $this->assertEquals(['skipped' => 1, 'imported' => 1], $wallabagV2Import->getSummary()); | 72 | $this->assertEquals(['skipped' => 1, 'imported' => 2], $wallabagV2Import->getSummary()); |
73 | } | 73 | } |
74 | 74 | ||
75 | public function testImportBadFile() | 75 | public function testImportBadFile() |