Closed carusogabriel closed 6 years ago
phpunit is in require-dev
section. How can in conflict with your composer.json?
@sokil Sorry, I didn't get your question :disappointed:
You have an application, which require "sokil/php-mongo" and you need in your application phpunit/phpunit" >=4.8.35. How phpunit of this lib may affect your phpunit, configuration section require-dev
used only if composer package is root (not reuiredby other package)? I don't understand your problem
Ah, okay, got it. I change this requirement, not because of other people applications, but ours, to keep our suite of tests up and running
but your tests in on your application. how dev reuirement of this lib may interfere you to update version of phpunit in composer.json of your app?
It won't affect. I just require a minimum version because of the new namespaces
, and in the future, when we decide to update to PHPUnit 6
, it's easier
Create app:
$ composer.init
Then require PHPMongo:
composer.phar require sokil/php-mongo
Then require PHPUnit:
composer.phar require phpunit/phpunit
Everything installs fine. Resulting composer.json:
{
"name": "root/test",
"authors": [
{
"name": "Dmytro Sokil",
"email": "dmytro.sokil@gmail.com"
}
],
"require": {
"sokil/php-mongo": "^1.22",
"phpunit/phpunit": "^6.4"
}
}
and all is fine.
I guess we are not getting each other point. Let me try to be more clear: this new PHPUnit\Framework\TestCase
namespace is new in some PHPUnit versions. I know that someone requires phpunit/phpunit
in their composer.json
, it will be overwritten, but, for us, developing php-mongo
and running vendor/bin/phpunit
, it is needed
Strange day o_O
I use the
PHPUnit\Framework\TestCase
notation instead ofPHPUnit_Framework_TestCase
while extending our TestCases. This will help us migrate to PHPUnit 6, that no longer support snake case class names.I just need to bump PHPUnit version to
>=4.8.35
, that support this namespace.