aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Tests/Import
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import')
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php10
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php11
2 files changed, 19 insertions, 2 deletions
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
index 496cf2d3..3ef852e5 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
@@ -2,8 +2,9 @@
2 2
3namespace Wallabag\ImportBundle\Tests\Import; 3namespace Wallabag\ImportBundle\Tests\Import;
4 4
5use Wallabag\UserBundle\Entity\User;
6use Wallabag\ImportBundle\Import\WallabagV1Import; 5use Wallabag\ImportBundle\Import\WallabagV1Import;
6use Wallabag\UserBundle\Entity\User;
7use Wallabag\CoreBundle\Entity\Entry;
7use Monolog\Logger; 8use Monolog\Logger;
8use Monolog\Handler\TestHandler; 9use Monolog\Handler\TestHandler;
9 10
@@ -71,7 +72,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
71 ->getMock(); 72 ->getMock();
72 73
73 $this->contentProxy 74 $this->contentProxy
74 ->expects($this->once()) 75 ->expects($this->exactly(3))
75 ->method('updateEntry') 76 ->method('updateEntry')
76 ->willReturn($entry); 77 ->willReturn($entry);
77 78
@@ -99,6 +100,11 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
99 ->method('getRepository') 100 ->method('getRepository')
100 ->willReturn($entryRepo); 101 ->willReturn($entryRepo);
101 102
103 $this->contentProxy
104 ->expects($this->exactly(3))
105 ->method('updateEntry')
106 ->willReturn(new Entry($this->user));
107
102 // check that every entry persisted are archived 108 // check that every entry persisted are archived
103 $this->em 109 $this->em
104 ->expects($this->any()) 110 ->expects($this->any())
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
index 341b1076..dbefdee3 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
@@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Tests\Import;
4 4
5use Wallabag\ImportBundle\Import\WallabagV2Import; 5use Wallabag\ImportBundle\Import\WallabagV2Import;
6use Wallabag\UserBundle\Entity\User; 6use Wallabag\UserBundle\Entity\User;
7use Wallabag\CoreBundle\Entity\Entry;
7use Monolog\Logger; 8use Monolog\Logger;
8use Monolog\Handler\TestHandler; 9use Monolog\Handler\TestHandler;
9 10
@@ -66,6 +67,11 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
66 ->method('getRepository') 67 ->method('getRepository')
67 ->willReturn($entryRepo); 68 ->willReturn($entryRepo);
68 69
70 $this->contentProxy
71 ->expects($this->exactly(2))
72 ->method('updateEntry')
73 ->willReturn(new Entry($this->user));
74
69 $res = $wallabagV2Import->import(); 75 $res = $wallabagV2Import->import();
70 76
71 $this->assertTrue($res); 77 $this->assertTrue($res);
@@ -90,6 +96,11 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
90 ->method('getRepository') 96 ->method('getRepository')
91 ->willReturn($entryRepo); 97 ->willReturn($entryRepo);
92 98
99 $this->contentProxy
100 ->expects($this->exactly(2))
101 ->method('updateEntry')
102 ->willReturn(new Entry($this->user));
103
93 // check that every entry persisted are archived 104 // check that every entry persisted are archived
94 $this->em 105 $this->em
95 ->expects($this->any()) 106 ->expects($this->any())