aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
diff options
context:
space:
mode:
authorJerome Charaoui <jerome@riseup.net>2016-12-07 15:16:49 -0500
committerJeremy Benoist <jbenoist@20minutes.fr>2017-06-01 09:48:14 +0200
commitd0e9b3d640acce49068d1a2c5603b92c1bda363e (patch)
tree1b992438ca153c18596f88ee7bec7d98b8984264 /tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
parent1c5da417e4ddb14223f9af6e5cea6778e5c0fd08 (diff)
downloadwallabag-d0e9b3d640acce49068d1a2c5603b92c1bda363e.tar.gz
wallabag-d0e9b3d640acce49068d1a2c5603b92c1bda363e.tar.zst
wallabag-d0e9b3d640acce49068d1a2c5603b92c1bda363e.zip
Add disableContentUpdate import option
This commit also decouples the "import" and "update" functions inside ContentProxy. If a content array is available, it must be passed to the new importEntry method.
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
index 5cc04aa5..e1acf569 100644
--- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
@@ -100,7 +100,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
100 100
101 $this->contentProxy 101 $this->contentProxy
102 ->expects($this->exactly(2)) 102 ->expects($this->exactly(2))
103 ->method('updateEntry') 103 ->method('importEntry')
104 ->willReturn(new Entry($this->user)); 104 ->willReturn(new Entry($this->user));
105 105
106 $res = $wallabagV2Import->import(); 106 $res = $wallabagV2Import->import();
@@ -129,7 +129,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
129 129
130 $this->contentProxy 130 $this->contentProxy
131 ->expects($this->exactly(2)) 131 ->expects($this->exactly(2))
132 ->method('updateEntry') 132 ->method('importEntry')
133 ->willReturn(new Entry($this->user)); 133 ->willReturn(new Entry($this->user));
134 134
135 // check that every entry persisted are archived 135 // check that every entry persisted are archived
@@ -165,7 +165,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
165 165
166 $this->contentProxy 166 $this->contentProxy
167 ->expects($this->never()) 167 ->expects($this->never())
168 ->method('updateEntry'); 168 ->method('importEntry');
169 169
170 $producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer') 170 $producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer')
171 ->disableOriginalConstructor() 171 ->disableOriginalConstructor()
@@ -201,7 +201,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
201 201
202 $this->contentProxy 202 $this->contentProxy
203 ->expects($this->never()) 203 ->expects($this->never())
204 ->method('updateEntry'); 204 ->method('importEntry');
205 205
206 $factory = new RedisMockFactory(); 206 $factory = new RedisMockFactory();
207 $redisMock = $factory->getAdapter('Predis\Client', true); 207 $redisMock = $factory->getAdapter('Predis\Client', true);
@@ -278,7 +278,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
278 278
279 $this->contentProxy 279 $this->contentProxy
280 ->expects($this->exactly(2)) 280 ->expects($this->exactly(2))
281 ->method('updateEntry') 281 ->method('importEntry')
282 ->will($this->throwException(new \Exception())); 282 ->will($this->throwException(new \Exception()));
283 283
284 $res = $wallabagV2Import->import(); 284 $res = $wallabagV2Import->import();