mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Reduce imported entries
Down from 2.2 minutes to 1.39 minutes
This commit is contained in:
parent
74a75f7d43
commit
cf05a1ae34
8 changed files with 23 additions and 491 deletions
|
@ -67,14 +67,14 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testImport()
|
||||
{
|
||||
$readabilityImport = $this->getReadabilityImport(false, 23);
|
||||
$readabilityImport = $this->getReadabilityImport(false, 3);
|
||||
$readabilityImport->setFilepath(__DIR__.'/../fixtures/readability.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entryRepo->expects($this->exactly(23))
|
||||
$entryRepo->expects($this->exactly(3))
|
||||
->method('findByUrlAndUserId')
|
||||
->willReturn(false);
|
||||
|
||||
|
@ -88,14 +88,14 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
->getMock();
|
||||
|
||||
$this->contentProxy
|
||||
->expects($this->exactly(23))
|
||||
->expects($this->exactly(3))
|
||||
->method('updateEntry')
|
||||
->willReturn($entry);
|
||||
|
||||
$res = $readabilityImport->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 23, 'queued' => 0], $readabilityImport->getSummary());
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 3, 'queued' => 0], $readabilityImport->getSummary());
|
||||
}
|
||||
|
||||
public function testImportAndMarkAllAsRead()
|
||||
|
@ -165,7 +165,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
->getMock();
|
||||
|
||||
$producer
|
||||
->expects($this->exactly(23))
|
||||
->expects($this->exactly(3))
|
||||
->method('publish');
|
||||
|
||||
$readabilityImport->setProducer($producer);
|
||||
|
@ -173,7 +173,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
$res = $readabilityImport->setMarkAsRead(true)->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 0, 'queued' => 23], $readabilityImport->getSummary());
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 0, 'queued' => 3], $readabilityImport->getSummary());
|
||||
}
|
||||
|
||||
public function testImportWithRedis()
|
||||
|
@ -211,7 +211,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
$res = $readabilityImport->setMarkAsRead(true)->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 0, 'queued' => 23], $readabilityImport->getSummary());
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 0, 'queued' => 3], $readabilityImport->getSummary());
|
||||
|
||||
$this->assertNotEmpty($redisMock->lpop('readability'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue