Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

add phpunit 6 require #40

Merged
merged 2 commits into from
Feb 4, 2017
Merged

Conversation

samsonasik
Copy link
Contributor

No description provided.

@@ -14,7 +14,7 @@
},
"require": {
"php": "^5.6 || ^7.0",
"phpunit/phpunit": "^4.0 || ^5.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0",
Copy link
Member

@froschdesign froschdesign Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work with the current version of zend-test, because in PHPUnit 6 the class PHPUnit_Framework_TestCase no longer exists.

Copy link
Contributor Author

@samsonasik samsonasik Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can change the code with class_alias:

use PHPUnit\Framework\TestCase;

if (! class_exists(TestCase::class)) {
    class_alias(\PHPUnit_Framework_TestCase::class, TestCase::class);
}

abstract class AbstractControllerTestCase extends TestCase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ;)

@Ocramius
Copy link
Member

Ocramius commented Feb 4, 2017

@samsonasik I think this should target develop

@samsonasik samsonasik changed the base branch from master to develop February 4, 2017 21:13
@samsonasik
Copy link
Contributor Author

@Ocramius done ;)

@Ocramius
Copy link
Member

Ocramius commented Feb 4, 2017

@samsonasik needs a rebase now :P

@samsonasik
Copy link
Contributor Author

@Ocramius done ;), rebased ;)

@Ocramius Ocramius added this to the 3.1.0 milestone Feb 4, 2017
@Ocramius
Copy link
Member

Ocramius commented Feb 4, 2017

👍 thanks!

@Ocramius Ocramius merged commit 0eff87c into zendframework:develop Feb 4, 2017
@samsonasik samsonasik deleted the patch-1 branch February 4, 2017 21:25
@froschdesign
Copy link
Member

@samsonasik and @Ocramius
Thanks! 👍

use Zend\Router\RouteMatch;
use Zend\Test\PHPUnit\Controller\AbstractConsoleControllerTestCase;

if (! class_exists(ExpectationFailedException::class)) {
class_alias(\PHPUnit_Framework_ExpectationFailedException::class, ExpectationFailedException::class);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, wish I'd had a chance to review before merge.

All these class_alias calls should likely be in a single file that is added via an autoload_dev section of the composer.json. That way the aliases are created when needed, and outside the class file declarations themselves.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants