Skip to content

Better to move phpunit/phpunit into require-dev #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ouyangde opened this issue Dec 9, 2015 · 4 comments
Closed

Better to move phpunit/phpunit into require-dev #5

ouyangde opened this issue Dec 9, 2015 · 4 comments

Comments

@ouyangde
Copy link

ouyangde commented Dec 9, 2015

No description provided.

@malkusch
Copy link
Member

malkusch commented Dec 9, 2015

May I ask why?

require-dev:

Lists packages required for developing this package, or running tests, etc.

For php-mock-phpunit PHPUnit is more than that. It's a hard dependency.

Where do you see the benefit in having it in require-dev?

@malkusch malkusch closed this as completed Dec 9, 2015
@ouyangde
Copy link
Author

Yes, it actually makes no diffrences. For every normal packages, they have phpunit in require-dev, so why move it into require? (Notice that there is no diffrences in use.)

There is another scene: Suppose that I already have phpunit installed as cli-tools, then the require for phpunit/phpunit is redundant. If had it removed, I can require php-mock-phpunit, then composer install weil run more quickly then before and unittest can still be performed.

@malkusch
Copy link
Member

Yes, it actually makes no diffrences.

It does. If one for what ever reason would not specify phpunit as dependency php-mock-phpunit would appear broken. More over php-mock-phpunit is not compatible with every phpunit version. If someone has let's say a dependency to phpunit-3 and wants to require php-mock-phpunit, composer will clearly say what's wrong. This will not happen if phpunit is a require-dev dependency of php-mock-phpunit.

Suppose that I already have phpunit installed as cli-tools

It's not a good practice to suppose such things. If you want to manage your dependencies your self, don't use composer.

@ouyangde
Copy link
Author

Yes, it actually makes no diffrences.

I mean, if I always require-dev php-mock-phpunit, (maybe this is a good practice,) it makes no diffrences whether php-mock-phpunit require or require-dev phpunit/phpunit. When I run composer install --dev, both of them will be installed, when composer install --no-dev, none of them will be installed.

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

No branches or pull requests

2 participants