tags:

views:

522

answers:

2

Hi,

I use phpUnit on a integration server to run all tests and if I lauch phpunit command from the command line, I receive

PHPUnit 3.2.18 by Sebastian Bergmann.
F..III..I......I.IIII...
Time: 6 seconds
There was 1 failure:

1) Warning(PHPUnit_Framework_Warning)
No tests found in class "TU".
FAILURES
Tests: 24, Failures: 1, Incomplete: 9.

Via apache, running the same test file :

PHPUnit 3.2.18 by Sebastian Bergmann.
..III..I......I.IIII...
Time: 7 seconds

OK, but incomplete or skipped tests!
Tests: 23, Incomplete: 9.

My TU class just include all tests classes with a $suite->addTestFile(), and which have two static functions : main() which run all the tests, and suite() which return the tests suite. But the TU class is not in the primary file given as parameter to phpunit command, it's a generic class wich scan files and list all test class.

I have the same problem with a class witch extends PHPUnit_Framework_TestCase to add specific assert(), wich is not included via $suite->addTestFile() but only by a require().

How can I correct this? Thanks in advance

Regards Cédric

A: 

Looks like you are using two different php.ini files for command line and Apache.

On most unixoid systems, running

diff /etc/php*/*/php.ini

should show you the differences.

On Windows systems, use the search to find files named php.ini. In most cases, you can just copy the Apache configuration file to the CLI one.

phihag
I don't think so.dev@devweb/~ php -i | grep php.iniConfiguration File (php.ini) Path => /etcLoaded Configuration File => /etc/php.iniphpinfo() via apache : Loaded Configuration File /etc/php.iniI actually think it's a phpunit issue.
Cédric Girard
+2  A: 

For the class wich extends PHPUnit_Framework_TestCase, it should be abstract, and the warning disapear. For the first problem, it seems it is a bug.

Cédric Girard