require-dev phpunit/phpunit in composer.json

8 views
Skip to first unread message

Steve Pavarno

unread,
Jan 2, 2017, 8:56:52 AM1/2/17
to The Aura Project for PHP
Hi

Why do many aura packages not have require-dev phpunit in composer.json even though there is a development dependency on it?
eg https://github.com/auraphp/Aura.Intl/blob/3.x/composer.json, ditto for Aura.Sql, Aura.SqlQuery.

What would be nice is if we could
git clone ...
composer install
./vendor/bin/phpunit
like is possible on many other packages.
With the current composer.json, you need to install a global phpunit to run the tests. And tools like phpStorm throw up lots of warnings that \PHPUnit_Framework_TestCase and all its methods are not defined. You have to manually edit the project config and add an include path to the global phpunit install to make these errors go away. phpunit is developing quickly: with a 4.0 and 5.0 release in the last 12 months. Specifying which version of phpunit is required in composer.json may help with compatibility issues, especially if someone is working on multiple open source packages and has some kind of conflict with their global phpunit install between packages.

thanks for your patience with my (hopefully not too dumb) question
Steve

Hari K T

unread,
Jan 2, 2017, 9:14:04 AM1/2/17
to aur...@googlegroups.com
Hey Steve,

Aura packages should work with phpunit 4 and 5 versions I believe. I have noticed a few issues on some packages and those were fixed. ( It was with getMock method ) .

We assumed phpunit is already installed and is global in the system. Basically it was to help with people who have low bandwidth. But I think that is not the case for now for composer keep things in cache. Also you can tell composer not to install require-dev dependencies.

So you are right, may be we could add phpunit into composer.json . Lets see what Paul M Jones thinks about the same.

Thank you

Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Jones

unread,
Jan 2, 2017, 9:16:05 AM1/2/17
to aur...@googlegroups.com

> On Jan 2, 2017, at 08:14, Hari K T <ktha...@gmail.com> wrote:
>
> Hey Steve,
>
> Aura packages should work with phpunit 4 and 5 versions I believe. I have noticed a few issues on some packages and those were fixed. ( It was with getMock method ) .
>
> We assumed phpunit is already installed and is global in the system. Basically it was to help with people who have low bandwidth. But I think that is not the case for now for composer keep things in cache. Also you can tell composer not to install require-dev dependencies.
>
> So you are right, may be we could add phpunit into composer.json . Lets see what Paul M Jones thinks about the same.

For a long long time, I have not like the idea of adding PHPUnit to every package, mostly because I have 40+ packages (most are Aura) and that's a lot of PHPUnit installs.

But I have reluctantly changed my mind.

Time to start adding "require-dev: phpunit/phpunit".


--
Paul M. Jones
pmjo...@gmail.com
http://paul-m-jones.com

Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp

Solving the N+1 Problem in PHP
https://leanpub.com/sn1php



Hari K T

unread,
Jan 2, 2017, 10:06:51 AM1/2/17
to aur...@googlegroups.com
Time to start adding "require-dev: phpunit/phpunit".

That is a good news Paul :-) .

If there is anyone willing to send PR's you are very welcome :-) .
Reply all
Reply to author
Forward
0 new messages