mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Fix countable in tests
This commit is contained in:
parent
7185fbff62
commit
5661e8d42a
1 changed files with 12 additions and 4 deletions
|
@ -221,7 +221,7 @@ class ContentProxyTest extends TestCase
|
||||||
$tagger->expects($this->once())
|
$tagger->expects($this->once())
|
||||||
->method('tag');
|
->method('tag');
|
||||||
|
|
||||||
$validator = $this->getValidator();
|
$validator = $this->getValidator(false);
|
||||||
$validator->expects($this->once())
|
$validator->expects($this->once())
|
||||||
->method('validate')
|
->method('validate')
|
||||||
->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')]));
|
->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')]));
|
||||||
|
@ -262,7 +262,7 @@ class ContentProxyTest extends TestCase
|
||||||
$tagger->expects($this->once())
|
$tagger->expects($this->once())
|
||||||
->method('tag');
|
->method('tag');
|
||||||
|
|
||||||
$validator = $this->getValidator();
|
$validator = $this->getValidator(false);
|
||||||
$validator->expects($this->exactly(2))
|
$validator->expects($this->exactly(2))
|
||||||
->method('validate')
|
->method('validate')
|
||||||
->will($this->onConsecutiveCalls(
|
->will($this->onConsecutiveCalls(
|
||||||
|
@ -545,11 +545,19 @@ class ContentProxyTest extends TestCase
|
||||||
return new NullLogger();
|
return new NullLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getValidator()
|
private function getValidator($withDefaultMock = true)
|
||||||
{
|
{
|
||||||
return $this->getMockBuilder(RecursiveValidator::class)
|
$mock = $this->getMockBuilder(RecursiveValidator::class)
|
||||||
->setMethods(['validate'])
|
->setMethods(['validate'])
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
|
if ($withDefaultMock) {
|
||||||
|
$mock->expects($this->any())
|
||||||
|
->method('validate')
|
||||||
|
->willReturn(new ConstraintViolationList());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $mock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue