mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 19:11:07 +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')
|
->method('satisfies')
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
|
|
||||||
$this->rulerz
|
$query = $this->getMockBuilder('Doctrine\ORM\AbstractQuery')
|
||||||
->method('filter')
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$query
|
||||||
|
->expects($this->once())
|
||||||
|
->method('getResult')
|
||||||
->willReturn([new Entry($user), new Entry($user)]);
|
->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);
|
$entries = $this->tagger->tagAllForUser($user);
|
||||||
|
|
||||||
$this->assertCount(2, $entries);
|
$this->assertCount(2, $entries);
|
||||||
|
@ -222,6 +241,7 @@ class RuleBasedTaggerTest extends TestCase
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$config = new Config($user);
|
$config = new Config($user);
|
||||||
|
$config->setReadingSpeed(200);
|
||||||
|
|
||||||
$user->setConfig($config);
|
$user->setConfig($config);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue