aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle
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/CoreBundle
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/CoreBundle')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 16643938..1ad21d14 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -257,9 +257,8 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
257 257
258 $proxy = new ContentProxy((new Graby()), $tagger, $this->getLogger(), $this->fetchingErrorMessage); 258 $proxy = new ContentProxy((new Graby()), $tagger, $this->getLogger(), $this->fetchingErrorMessage);
259 $entry = new Entry(new User()); 259 $entry = new Entry(new User());
260 $proxy->updateEntry( 260 $proxy->importEntry(
261 $entry, 261 $entry,
262 'http://0.0.0.0',
263 [ 262 [
264 'html' => str_repeat('this is my content', 325), 263 'html' => str_repeat('this is my content', 325),
265 'title' => 'this is my title', 264 'title' => 'this is my title',
@@ -294,7 +293,6 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
294 $entry = new Entry(new User()); 293 $entry = new Entry(new User());
295 $proxy->updateEntry( 294 $proxy->updateEntry(
296 $entry, 295 $entry,
297 'http://0.0.0.0',
298 [ 296 [
299 'html' => str_repeat('this is my content', 325), 297 'html' => str_repeat('this is my content', 325),
300 'title' => 'this is my title', 298 'title' => 'this is my title',
@@ -334,13 +332,14 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
334 $proxy = new ContentProxy($graby, $tagger, $this->getLogger(), $this->fetchingErrorMessage); 332 $proxy = new ContentProxy($graby, $tagger, $this->getLogger(), $this->fetchingErrorMessage);
335 333
336 $entry = new Entry(new User()); 334 $entry = new Entry(new User());
337 $proxy->updateEntry($entry, 'http://0.0.0.0', [ 335 $content = array(
338 'html' => str_repeat('this is my content', 325), 336 'html' => str_repeat('this is my content', 325),
339 'title' => 'this is my title', 337 'title' => 'this is my title',
340 'url' => 'http://1.1.1.1', 338 'url' => 'http://1.1.1.1',
341 'content_type' => 'text/html', 339 'content_type' => 'text/html',
342 'language' => 'fr', 340 'language' => 'fr',
343 ]); 341 );
342 $proxy->importEntry($entry, $content, true);
344 343
345 $this->assertCount(0, $entry->getTags()); 344 $this->assertCount(0, $entry->getTags());
346 } 345 }