Skip to content

Commit 88aa071

Browse files
committed
Allow use of newer PHPUnit on newer versions of PHP
This allows the 0.x series of this library to have passing tests on PHP 5.4 all the way up to PHP 7.3. I added an allowance for using the PHPUnit 7 series on versions of PHP that support it, and I made a few slight changes to tests and phpunit.xml.dist that allow the tests to continue running on both the older version of PHPUnit and the newer versions. FYI, when you choose to upgrade to PHPUnit 8.x for the 1.x series of this library, you'll need to make more changes to the tests that won't be backwards compatible with earlier versions of PHPUnit.
1 parent c08a0f6 commit 88aa071

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"illuminate/contracts": "~5.0",
2929
"mockery/mockery": "~0.9",
3030
"pagerfanta/pagerfanta": "~1.0.0",
31-
"phpunit/phpunit": "^4.8.35",
31+
"phpunit/phpunit": "^4.8.35 || ^7.5",
3232
"squizlabs/php_codesniffer": "~1.5",
3333
"zendframework/zend-paginator": "~2.3"
3434
},

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<logging>
1414
<log type="tap" target="build/report.tap"/>
1515
<log type="junit" target="build/report.junit.xml"/>
16-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
16+
<log type="coverage-html" target="build/coverage"/>
1717
<log type="coverage-text" target="build/coverage.txt"/>
1818
<log type="coverage-clover" target="build/logs/clover.xml"/>
1919
</logging>

test/ScopeFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ private function createSut()
6969
*/
7070
private function createManager()
7171
{
72-
return $this->getMock('League\\Fractal\\Manager');
72+
return $this->getMockBuilder('League\\Fractal\\Manager')->getMock();
7373
}
7474

7575
/**
7676
* @return ResourceInterface
7777
*/
7878
private function createResource()
7979
{
80-
return $this->getMock('League\\Fractal\\Resource\\ResourceInterface');
80+
return $this->getMockBuilder('League\\Fractal\\Resource\\ResourceInterface')->getMock();
8181
}
8282
}

test/TransformerAbstractTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ public function testParamBagIsProvidedForIncludes()
300300

301301
$transformer->setAvailableIncludes(['book']);
302302
$scope = new Scope($manager, new Item([], $transformer));
303-
$included = $transformer->processIncludedResources($scope, []);
303+
304+
$this->assertFalse($transformer->processIncludedResources($scope, []));
304305
}
305306

306307
/**

0 commit comments

Comments
 (0)