Skip to content

Commit

Permalink
Updated PHPUnit constraint to support both v5 and v6 (#63)
Browse files Browse the repository at this point in the history
* Updated PHPUnit constraint to support both v5 and v6

* Added PHPUnit_Framework_Assert class alias

* Use PHPUnit greater than 5.7
  • Loading branch information
MarioBlazek authored and andrerom committed Jul 7, 2017
1 parent a670e78 commit 3825099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Context/EzContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ protected function generateSiteAccess()
*/
public function prepareKernel( $event )
{
// temporary class alias
// for PHPUnit v6 adoption time
if (!class_exists('PHPUnit_Framework_Assert')) {
class_alias('PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert');
}

$container = $this->getKernel()->getContainer();

// Inject a properly generated siteaccess if the kernel is booted, and thus container is available.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": "^5.6|^7.0",
"ezsystems/ezpublish-kernel": "*",
"phpunit/phpunit": "~5.0"
"phpunit/phpunit": "^5.7|^6.0"
},
"autoload": {
"psr-0": {"EzSystems\\BehatBundle": ""}
Expand Down

0 comments on commit 3825099

Please sign in to comment.