->disableOriginalConstructor()
->getMock();
- $entryRepo->expects($this->exactly(2))
+ $entryRepo->expects($this->exactly(24))
->method('findByUrlAndUserId')
- ->will($this->onConsecutiveCalls(false, true));
+ ->willReturn(false);
$this->em
->expects($this->any())
->getMock();
$this->contentProxy
- ->expects($this->exactly(1))
+ ->expects($this->exactly(24))
->method('updateEntry')
->willReturn($entry);
$res = $readabilityImport->import();
$this->assertTrue($res);
- $this->assertEquals(['skipped' => 1, 'imported' => 1], $readabilityImport->getSummary());
+ $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
}
public function testImportAndMarkAllAsRead()
$entryRepo->expects($this->exactly(2))
->method('findByUrlAndUserId')
- ->will($this->onConsecutiveCalls(false, false));
+ ->will($this->onConsecutiveCalls(false, true));
$this->em
->expects($this->any())
->willReturn($entryRepo);
$this->contentProxy
- ->expects($this->exactly(2))
+ ->expects($this->exactly(1))
->method('updateEntry')
->willReturn(new Entry($this->user));
$this->assertTrue($res);
- $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary());
+ $this->assertEquals(['skipped' => 1, 'imported' => 1], $readabilityImport->getSummary());
}
public function testImportWithRabbit()
->getMock();
$producer
- ->expects($this->exactly(2))
+ ->expects($this->exactly(24))
->method('publish');
$readabilityImport->setProducer($producer);
$res = $readabilityImport->setMarkAsRead(true)->import();
$this->assertTrue($res);
- $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary());
+ $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
}
public function testImportWithRedis()
$res = $readabilityImport->setMarkAsRead(true)->import();
$this->assertTrue($res);
- $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary());
+ $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
$this->assertNotEmpty($redisMock->lpop('readability'));
}