FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19489&edit=1

ID: 19489
Updated by: maik@phpkuh.de
Reported By: maik at phpkuh dot de
Summary: phpunit warning: No tests found in class
Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu 12.04
Package Version: 1.3.4
PHP Version: 5.4.4
Assigned To: squiz
Roadmap Versions:
New Comment:

Wrongly assumed that single tests could be executed like
phpunit --bootstrap AllTests.php
CodeSniffer/Standards/PEAR/Tests/Commenting/
(bootstrapping approach is not perfect but all I needed was to autoload
the classes).

Got:
PHPUnit 3.6.11 by Sebastian Bergmann.
FFFF
Time: 0 seconds, Memory: 2.75Mb
There were 4 failures:
1) Warning
No tests found in class "PEAR_Tests_Commenting_ClassCommentUnitTest".
2) Warning
No tests found in class "PEAR_Tests_Commenting_FileCommentUnitTest".
3) Warning
No tests found in class
"PEAR_Tests_Commenting_FunctionCommentUnitTest".
4) Warning
No tests found in class "PEAR_Tests_Commenting_InlineCommentUnitTest".

After adding `public function testSniff() {}` to AbstractSniffUnitTest
got:
PHPUnit 3.6.11 by Sebastian Bergmann.
....
Time: 1 second, Memory: 4.00Mb
OK (4 tests, 0 assertions)

phpunit AllTests.php does work with both.

My intention was to debug a single (3rd party) Standard or part of it.
Using the full testsuite every time produced quit a lot of output.

I guess a custom bootstrap/ testsuite might have been the better choice
from the start.

Thanks!


Previous Comments:
------------------------------------------------------------------------

[2012-07-04 07:56:44] squiz

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
PHPUnit 3.6.11 correctly finds all my tests from both a git clone and a
PEAR installed
version of PHP_CodeSniffer 1.3.4.

I run the tests like this:
phpunit AllTests.php

Can you show me how you are running the tests and what output you get.
What code
you added to make them work for you would also be helpful if I can't
replicate this
myself.

------------------------------------------------------------------------

[2012-06-30 17:58:34] ookami

Description:
------------
Using phpunit 3.6.11 no tests could be found for derivates of
AbstractSniffUnitTest.

Adding a testVoid()-Method to said class fixes the issue.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 4, '12 at 8:50a
activeJul 4, '12 at 8:50a
posts1
users1
websitepear.php.net

1 user in discussion

Maik: 1 post

People

Translate

site design / logo © 2022 Grokbase