mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 11:01:04 +00:00
Fix tests
This commit is contained in:
parent
5c4993832e
commit
10d071a4f2
1 changed files with 22 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue