mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Add test for RabbitMQ
Also update Symfony deps
This commit is contained in:
parent
8664069e1a
commit
13470c3596
11 changed files with 487 additions and 2 deletions
|
@ -120,6 +120,46 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary());
|
||||
}
|
||||
|
||||
public function testImportWithRabbit()
|
||||
{
|
||||
$readabilityImport = $this->getReadabilityImport();
|
||||
$readabilityImport->setFilepath(__DIR__.'/../fixtures/readability.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entryRepo->expects($this->never())
|
||||
->method('findByUrlAndUserId');
|
||||
|
||||
$this->em
|
||||
->expects($this->never())
|
||||
->method('getRepository');
|
||||
|
||||
$entry = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Entry')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->contentProxy
|
||||
->expects($this->never())
|
||||
->method('updateEntry');
|
||||
|
||||
$producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$producer
|
||||
->expects($this->exactly(2))
|
||||
->method('publish');
|
||||
|
||||
$readabilityImport->setRabbitmqProducer($producer);
|
||||
|
||||
$res = $readabilityImport->setMarkAsRead(true)->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary());
|
||||
}
|
||||
|
||||
public function testImportBadFile()
|
||||
{
|
||||
$readabilityImport = $this->getReadabilityImport();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue