aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-12-18 10:14:00 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-12-18 13:29:34 +0100
commit5661e8d42af5d0557bf8017b515c51335757d6f2 (patch)
tree12f46e3ec208e42455164c8a7eea94ecd70e7603 /tests
parent7185fbff6294a810727e12ffd6684efe9ddaf75a (diff)
downloadwallabag-5661e8d42af5d0557bf8017b515c51335757d6f2.tar.gz
wallabag-5661e8d42af5d0557bf8017b515c51335757d6f2.tar.zst
wallabag-5661e8d42af5d0557bf8017b515c51335757d6f2.zip
Fix countable in tests
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php16
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}