[Fedora-php-devel-list] Packaging of PHP library test classes?

Remi Collet Fedora at FamilleCollet.com
Thu Jan 8 14:03:24 UTC 2015


Le 08/01/2015 00:29, Shawn Iwinski a écrit :
> Problem: I've run into another case where one package
> (php-guzzlehttp-guzzle) requires another package's (php-guzzlehttp-ringphp)
> test classes but the test classes are not provided in any package.  I'd
> like to include test classes as sub-packages so they could be installed if
> needed, but I'd also like to make them PSR-0 loadable instead of using
> individual "/usr/share/tests/*" directories for each package which I've
> done in the past.
> 
> I'm wondering in my case, could I create sub-package
> php-guzzlehttp-ringphp-tests that installs it's test classes into either:
> 
> 1) "/usr/share/php" so auto loading would work OOB

Seems a bad idea to provide this in the default include_path

(Yes I know some project start to store their unit test in the same
"src" tree than the library... because composer have a stupid rule to
ignore *Test.php file) [1]

> 2) "/usr/share/tests/php" (nothing uses this yet) that could be used for
> PSR-0 auto loading but would need to be specifically added to the include
> path when running phpunit

Seems better.
We don't even need a "single" PSR-0 tree.

So /usr/share/tests/<spkname> is also ok (and wouldn't change the need
to add this folder to the include_path on phpunit command options)



Remi

[1] something which need to be carefully handled in downstream packaging.


More information about the php-devel mailing list