1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

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.
This commit is contained in:
Jerome Charaoui 2016-12-07 15:16:49 -05:00 committed by Jeremy Benoist
parent 1c5da417e4
commit d0e9b3d640
No known key found for this signature in database
GPG key ID: FB413A58C7715C86
11 changed files with 118 additions and 60 deletions

View file

@ -257,9 +257,8 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$proxy = new ContentProxy((new Graby()), $tagger, $this->getLogger(), $this->fetchingErrorMessage);
$entry = new Entry(new User());
$proxy->updateEntry(
$proxy->importEntry(
$entry,
'http://0.0.0.0',
[
'html' => str_repeat('this is my content', 325),
'title' => 'this is my title',
@ -294,7 +293,6 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$entry = new Entry(new User());
$proxy->updateEntry(
$entry,
'http://0.0.0.0',
[
'html' => str_repeat('this is my content', 325),
'title' => 'this is my title',
@ -334,13 +332,14 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$proxy = new ContentProxy($graby, $tagger, $this->getLogger(), $this->fetchingErrorMessage);
$entry = new Entry(new User());
$proxy->updateEntry($entry, 'http://0.0.0.0', [
$content = array(
'html' => str_repeat('this is my content', 325),
'title' => 'this is my title',
'url' => 'http://1.1.1.1',
'content_type' => 'text/html',
'language' => 'fr',
]);
);
$proxy->importEntry($entry, $content, true);
$this->assertCount(0, $entry->getTags());
}