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
11 changed files with 118 additions and 60 deletions

View File

@ -89,7 +89,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
$this->contentProxy
->expects($this->exactly(3))
->method('updateEntry')
->method('importEntry')
->willReturn($entry);
$res = $readabilityImport->import();
@ -118,7 +118,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
$this->contentProxy
->expects($this->exactly(1))
->method('updateEntry')
->method('importEntry')
->willReturn(new Entry($this->user));
// check that every entry persisted are archived
@ -158,7 +158,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
$this->contentProxy
->expects($this->never())
->method('updateEntry');
->method('importEntry');
$producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer')
->disableOriginalConstructor()
@ -198,7 +198,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
$this->contentProxy
->expects($this->never())
->method('updateEntry');
->method('importEntry');
$factory = new RedisMockFactory();
$redisMock = $factory->getAdapter('Predis\Client', true);