diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 9a656dad..398592e1 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | |||
@@ -221,7 +221,7 @@ class ContentProxyTest extends TestCase | |||
221 | $tagger->expects($this->once()) | 221 | $tagger->expects($this->once()) |
222 | ->method('tag'); | 222 | ->method('tag'); |
223 | 223 | ||
224 | $validator = $this->getValidator(); | 224 | $validator = $this->getValidator(false); |
225 | $validator->expects($this->once()) | 225 | $validator->expects($this->once()) |
226 | ->method('validate') | 226 | ->method('validate') |
227 | ->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')])); | 227 | ->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')])); |
@@ -262,7 +262,7 @@ class ContentProxyTest extends TestCase | |||
262 | $tagger->expects($this->once()) | 262 | $tagger->expects($this->once()) |
263 | ->method('tag'); | 263 | ->method('tag'); |
264 | 264 | ||
265 | $validator = $this->getValidator(); | 265 | $validator = $this->getValidator(false); |
266 | $validator->expects($this->exactly(2)) | 266 | $validator->expects($this->exactly(2)) |
267 | ->method('validate') | 267 | ->method('validate') |
268 | ->will($this->onConsecutiveCalls( | 268 | ->will($this->onConsecutiveCalls( |
@@ -545,11 +545,19 @@ class ContentProxyTest extends TestCase | |||
545 | return new NullLogger(); | 545 | return new NullLogger(); |
546 | } | 546 | } |
547 | 547 | ||
548 | private function getValidator() | 548 | private function getValidator($withDefaultMock = true) |
549 | { | 549 | { |
550 | return $this->getMockBuilder(RecursiveValidator::class) | 550 | $mock = $this->getMockBuilder(RecursiveValidator::class) |
551 | ->setMethods(['validate']) | 551 | ->setMethods(['validate']) |
552 | ->disableOriginalConstructor() | 552 | ->disableOriginalConstructor() |
553 | ->getMock(); | 553 | ->getMock(); |
554 | |||
555 | if ($withDefaultMock) { | ||
556 | $mock->expects($this->any()) | ||
557 | ->method('validate') | ||
558 | ->willReturn(new ConstraintViolationList()); | ||
559 | } | ||
560 | |||
561 | return $mock; | ||
554 | } | 562 | } |
555 | } | 563 | } |