Fix tests

This commit is contained in:
Jeremy Benoist 2022-03-02 19:28:48 +01:00
parent 5c4993832e
commit 10d071a4f2
No known key found for this signature in database
GPG Key ID: BCA73962457ACC3C

View File

@ -202,10 +202,29 @@ class RuleBasedTaggerTest extends TestCase
->method('satisfies')
->willReturn(true);
$this->rulerz
->method('filter')
$query = $this->getMockBuilder('Doctrine\ORM\AbstractQuery')
->disableOriginalConstructor()
->getMock();
$query
->expects($this->once())
->method('getResult')
->willReturn([new Entry($user), new Entry($user)]);
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
->disableOriginalConstructor()
->getMock();
$qb
->expects($this->once())
->method('getQuery')
->willReturn($query);
$this->entryRepository
->expects($this->once())
->method('getBuilderForAllByUser')
->willReturn($qb);
$entries = $this->tagger->tagAllForUser($user);
$this->assertCount(2, $entries);
@ -222,6 +241,7 @@ class RuleBasedTaggerTest extends TestCase
{
$user = new User();
$config = new Config($user);
$config->setReadingSpeed(200);
$user->setConfig($config);