Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpunit warning on an utilitary class

Tags:

php

phpunit

I use phpUnit on a integration server to run all tests and if I launch 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 which scan files and list all test class.

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

How can I correct this?

like image 335
Cédric Girard Avatar asked Dec 24 '08 13:12

Cédric Girard


1 Answers

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.

like image 184
Cédric Girard Avatar answered Sep 21 '22 12:09

Cédric Girard