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

Provide PHPUnit class aliases to other projects implementing zend-test #49

Conversation

boesing
Copy link
Member

@boesing boesing commented May 21, 2017

Since the file autoload/phpunit-class-aliases.php is stored within autoload-dev, no remote project will ever get those aliases which will cause to problems if they're using PHPUnit in versions less than 6.0.

We should provide those aliases to them from within autoload so there is no need in remote projects to manually add those aliases themselves or by using a creepy composer configuration like:

"autoload-dev": {
    "files": [
        "vendor/zendframework/zend-test/autoload/phpunit-class-aliases.php"
    ]
}

@Ocramius
Copy link
Member

Ocramius commented May 21, 2017 via email

@boesing boesing force-pushed the bugfix/autoloading-in-external-projects branch from a5566db to 66eb00d Compare May 21, 2017 13:03
@boesing
Copy link
Member Author

boesing commented May 21, 2017

@Ocramius Maybe, but this library is allowing PHPUnit less than 6. I dont think that PHPUnit should handle this. PHPUnit is not responsible for libraries which allow multiple, BC broken major versions.

This library whether should change its dependencies to a version which does not need those aliases or it has to provide proper autoloading which can be used in all projects relying on this one.

Copy link
Member Author

@boesing boesing left a comment

Choose a reason for hiding this comment

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

I've used composer update nothing for this one.

@dillchuk
Copy link

To anyone needing this change, you can install it here:

composer require illchuk/phpunit-class-aliases

@boesing
Copy link
Member Author

boesing commented Sep 14, 2017

@dillchuk thats definitely a useful package but I am still thinking that this package might provide those aliases since it provides testing abilities to other projects.
Therefore, this project is supposed to be "required" as a development package in other projects (no one would use this as productive package I guess) and could therefore just use your package or create an own alias map so no other project which is using zend-test have to bother with that error.

Xerkus added a commit that referenced this pull request Oct 29, 2017
@Xerkus Xerkus closed this in e594969 Oct 29, 2017
Xerkus added a commit that referenced this pull request Oct 29, 2017
@Xerkus Xerkus added this to the 3.1.1 milestone Oct 29, 2017
@Xerkus
Copy link
Member

Xerkus commented Oct 29, 2017

Merging it because aliases are required for zend-test itself to work with older phpunit, not for tests using zend-test

@boesing boesing deleted the bugfix/autoloading-in-external-projects branch October 30, 2017 07:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants