From: <gue...@un...> - 2012-09-04 07:01:19
|
Thanks David! I have given it a quick try and I was successful. I will look into more intensively later and hopefully get a better understanding of PHPUnit. But shouldn't be so far away from the brother junit, I guess. I have to confess - so far I have overseen the tests-directory in the root VuFind directory .... Have a nice day! Günter On 09/04/2012 06:02 AM, David Maus wrote: > At Mon, 03 Sep 2012 21:31:16 +0200, > gue...@un... wrote: >> phpunit ISBNTest.php >> PHP Fatal error: Class 'VuFind\Tests\TestCase' not found in >> /home/swissbib/swissbib/code_checkout_svn/vf220120711/vufind/module/VuFind/tests/Code/ISBNTest.php >> on line 42 >> PHP Stack trace: >> PHP 1. {main}() /usr/bin/phpunit:0 >> PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 >> PHP 3. PHPUnit_TextUI_Command->run() >> /usr/share/php/PHPUnit/TextUI/Command.php:130 >> PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() >> /usr/share/php/PHPUnit/TextUI/Command.php:150 >> PHP 5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() >> /usr/share/php/PHPUnit/Runner/BaseTestRunner.php:104 >> PHP 6. PHPUnit_Runner_StandardTestSuiteLoader->load() >> /usr/share/php/PHPUnit/Runner/BaseTestRunner.php:168 >> PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() >> /usr/share/php/PHPUnit/Runner/StandardTestSuiteLoader.php:78 >> PHP 8. PHPUnit_Util_Fileloader::load() >> /usr/share/php/PHPUnit/Util/Fileloader.php:79 >> PHP 9. include_once() /usr/share/php/PHPUnit/Util/Fileloader.php:95 > If you simply try to run the test defined in a single file this way > PHPUnit does not load its configuration and bootstrap code which among > other things sets up the class loader. > > The PHPUnit configuration is in the subdirectory `tests/' in vf2 root > directory. This works here: > > ,---- > | phpunit --bootstrap /home/dmaus/programming/php/vf2-dev/tests/bootstrap.php --configuration /home/dmaus/programming/php/vf2-dev/tests/phpunit.xml ISBNTest.php > `---- > > Running a test for a single testcase from the `tests/' subdirectory > works, too. PHPUnit looks for its configuration in current directory > if not told otherwise. E.g. > > ,---- > | phpunit ../module/VuFind/tests/Code/ISBNTest.php > `---- > > Best, > -- David > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dm...@ja... > Email..... dm...@ic... -- Universität Basel Universitätsbibliothek Günter Hipler Projekt SwissBib Schoenbeinstrasse 18-20 4056 Basel, Schweiz Tel.: + 41 (0)61 267 31 12 Fax: ++41 61 267 3103 E-M...@un... URL:www.swissbib.org /http://www.ub.unibas.ch/ |