Skip to content

Commit

Permalink
Merge pull request #210 from OndraM/feature/phpunit5-compatibility
Browse files Browse the repository at this point in the history
Make tests compatible also with PHPUnit 5
  • Loading branch information
richsage authored Nov 17, 2016
2 parents 6675cff + 8f020ab commit b69b72c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~4",
"phpunit/phpunit": "~4 | ~5",
"doctrine/orm": "~2.3",
"mandango/mandango": "~1.0@dev",
"mandango/mondator": "~1.0@dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private function isDoctrine23OrGreaterNotAvailable()

private function createSelectableMock()
{
return $this->getMock('Doctrine\Common\Collections\Selectable');
return $this->getMockBuilder('Doctrine\Common\Collections\Selectable')->getMock();
}

private function createCriteria()
Expand Down Expand Up @@ -71,7 +71,7 @@ public function testGetNbResults()

private function createCollectionMock()
{
return $this->getMock('Doctrine\Common\Collections\Collection');
return $this->getMockBuilder('Doctrine\Common\Collections\Collection')->getMock();
}

public function testGetSlice()
Expand Down
2 changes: 1 addition & 1 deletion tests/Pagerfanta/Tests/Adapter/SolariumAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private function createClientMock()

private function createQueryMock()
{
return $this->getMock($this->getQueryClass());
return $this->getMockBuilder($this->getQueryClass())->getMock();
}

private function createQueryStub()
Expand Down
2 changes: 1 addition & 1 deletion tests/Pagerfanta/Tests/PagerfantaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PagerfantaTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->adapter = $this->getMock('Pagerfanta\Adapter\AdapterInterface');
$this->adapter = $this->getMockBuilder('Pagerfanta\Adapter\AdapterInterface')->getMock();
$this->pagerfanta = new Pagerfanta($this->adapter);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Pagerfanta/Tests/View/OptionableViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function setUp()

private function createPagerfantaMock()
{
return $this->getMock('Pagerfanta\PagerfantaInterface');
return $this->getMockBuilder('Pagerfanta\PagerfantaInterface')->getMock();
}

private function createRouteGenerator()
Expand Down Expand Up @@ -52,7 +52,7 @@ public function testRenderShouldMergeOptions()

private function createViewMock($expectedOptions)
{
$view = $this->getMock('Pagerfanta\View\ViewInterface');
$view = $this->getMockBuilder('Pagerfanta\View\ViewInterface')->getMock();
$view
->expects($this->once())
->method('render')
Expand Down
8 changes: 4 additions & 4 deletions tests/Pagerfanta/Tests/View/ViewFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class ViewFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testFactory()
{
$view1 = $this->getMock('Pagerfanta\View\ViewInterface');
$view2 = $this->getMock('Pagerfanta\View\ViewInterface');
$view3 = $this->getMock('Pagerfanta\View\ViewInterface');
$view4 = $this->getMock('Pagerfanta\View\ViewInterface');
$view1 = $this->getMockBuilder('Pagerfanta\View\ViewInterface')->getMock();
$view2 = $this->getMockBuilder('Pagerfanta\View\ViewInterface')->getMock();
$view3 = $this->getMockBuilder('Pagerfanta\View\ViewInterface')->getMock();
$view4 = $this->getMockBuilder('Pagerfanta\View\ViewInterface')->getMock();

$factory = new ViewFactory();

Expand Down
2 changes: 1 addition & 1 deletion tests/Pagerfanta/Tests/View/ViewTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp()

private function createAdapterMock()
{
return $this->getMock('Pagerfanta\Adapter\AdapterInterface');
return $this->getMockBuilder('Pagerfanta\Adapter\AdapterInterface')->getMock();
}

/**
Expand Down

0 comments on commit b69b72c

Please sign in to comment.