From e1e2b5cd980aa20cb1cc8c124479a5affa93ab8d Mon Sep 17 00:00:00 2001 From: Mike van Riel Date: Sat, 13 Jun 2015 21:46:07 +0200 Subject: [PATCH] Tweak phpunit configuration and fix mocking errors --- phpunit.xml.dist | 17 +++++++++++++++-- tests/unit/DocBlockTest.php | 8 ++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8b7a6f1..4393b02 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,15 @@ - + - + ./tests/ @@ -14,4 +21,10 @@ ./vendor/ + + + diff --git a/tests/unit/DocBlockTest.php b/tests/unit/DocBlockTest.php index 403f52b..8e6c0b7 100644 --- a/tests/unit/DocBlockTest.php +++ b/tests/unit/DocBlockTest.php @@ -117,7 +117,7 @@ class DocBlockTest extends \PHPUnit_Framework_TestCase $tag1->shouldReceive('getName')->andReturn('abc'); $tag2->shouldReceive('getName')->andReturn('abcd'); - $tag3->shouldReceive('getName')->never(); + $tag3->shouldReceive('getName')->andReturn('ab'); $fixture = new DocBlock('', null, $tags); @@ -152,9 +152,9 @@ class DocBlockTest extends \PHPUnit_Framework_TestCase $tag3 = m::mock(DocBlock\Tag::class); $tags = [$tag1, $tag2, $tag3]; - $tag1->shouldReceive('getName')->andReturn('abc'); - $tag2->shouldReceive('getName')->andReturn('abcd'); - $tag3->shouldReceive('getName')->never(); + $tag1->shouldReceive('getName')->twice()->andReturn('abc'); + $tag2->shouldReceive('getName')->twice()->andReturn('abcd'); + $tag3->shouldReceive('getName')->once(); $fixture = new DocBlock('', null, $tags);