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

add phpunit 6 require - #40

Merged
Ocramius merged 2 commits into
zendframework:developfrom
samsonasik:patch-1
Feb 4, 2017
Merged

add phpunit 6 require#40
Ocramius merged 2 commits into
zendframework:developfrom
samsonasik:patch-1

Conversation

@samsonasik

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread composer.json
"require": {
"php": "^5.6 || ^7.0",
"phpunit/phpunit": "^4.0 || ^5.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0",

@froschdesign froschdesign Feb 3, 2017

Copy link
Copy Markdown
Member

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.

@samsonasik samsonasik Feb 3, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done ;)

@Ocramius

Ocramius commented Feb 4, 2017

Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor Author

@Ocramius done ;)

@Ocramius

Ocramius commented Feb 4, 2017

Copy link
Copy Markdown
Member

@samsonasik needs a rebase now :P

@samsonasik

Copy link
Copy Markdown
Contributor Author

@Ocramius done ;), rebased ;)

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

Ocramius commented Feb 4, 2017

Copy link
Copy Markdown
Member

👍 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
Copy Markdown
Member

@samsonasik and @Ocramius
Thanks! 👍


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

Copy link
Copy Markdown
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