Re: AllTests.php and pear run-tests

From: Date: Tue, 03 Jul 2007 04:54:28 +0000
Subject: Re: AllTests.php and pear run-tests
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47155@lists.php.net to get a copy of this message
> dynamically. The problem is that pear run-tests requires AllTest.php > to have a class AllTests inside (better, phpunit requires this if you > don't pass a custom class name). Having 100 classes named AllTests > does not work when building a global test suite (class already > defined). That why I propose that "pear run-tests -pu Package_Name" > executes phpunit with the test suite classname Package_Name_AllTests > in AllTests.php. All existing AllTests.php would need to get their > classes renamed accordingly. After sleeping a night over it, I found another method that would work but is not really good: <?php if (class_exists('AllTests')) { $classname = 'HTML_BBCodeParser_AllTests'; } else { $classname = 'AllTests'; } class $classname { ... } ?> This would allow us to make a global test suite but still not needing to change pear. The drawback is that the classname is unpredictable, but how high is the chance that someone uses the AllTests.php files for different purposes? -- Mit freundlichen Grüßen/Regards, Christian Weiske

« previous php.pear.dev (#47155) next »