PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Testing » PHPUnit2 » Bug #7082

PEAR Filenaming Scheme

Details

Request #7082PEAR Filenaming Scheme
Submitted2006-03-09 20:31 UTC
Frommaxx dot gass at gmail dot com
StatusBogus
PackagePHPUnit2
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-03-09 20:31 UTC] maxx dot gass at gmail dot com

Description:
------------
If I use

phpunit MyTest.php

it works and runs MyTest

But

phpunit My/SomethingTest.php

doesn't run My_SomethingTest but fails.

Would be nice if PHPUnit could work with this as it
conforms with PEAR Coding Standards.

[2006-03-10 06:46 UTC] sebastian at php dot net

Thank you for taking the time to write to us, but this is not
a bug.

PHPUnit correctly handles the PEAR Coding Standards, just in another way than the one you tried.

When you look at the output of phpunit --help you'll see

Usage: phpunit [switches] UnitTest [UnitTest.php]

UnitTest means the class name of the test case, not its source file.

Running

$ phpunit Project_Package_Class

will look of the Project_Package_Class class in ./Project/Package/Class.php and if it is not found there the include_path will be searched for Project/Package/Class.php.

[2006-03-10 10:20 UTC] maxx dot gass at gmail dot com

I know that this works (I used it) but the way I proposed
works with filename completion on the command line.

It would be even better if PHPUnit would work with any
class or file naming (SimpleTest does :)). Could be done
with get_declared_classes(), looking for classes that
extend PHPUnit2_Framework_TestCase

[2006-03-10 10:31 UTC] sebastian at php dot net

It does work with any class or file naming, see http://www.phpunit.de/pocket_guide/3.0/en/textui.html.