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

ID: 19038
Updated by: danielc@analysisandsolutions.com
Reported By: danielc at analysisandsolutions dot com
Summary: tests run twice / main() not needed
Status: Bogus
Type: Bug
Package: HTML_QuickForm2
Package Version: SVN
PHP Version: 5.4.0alpha1
Roadmap Versions:
New Comment:

I noticed your package also has a "tests-nomain" directory. FYI, I
figured out a way to be able to have AllTests.php called by either PHP
or PHPUnit and work right. See

Previous Comments:

[2011-11-15 10:44:32] avb

-Status: Open
+Status: Bogus
- Doctor, it hurts when I do it like this!
- Don't do it like this, then.

You should either run

$ phpunit ./tests/QuickForm2/Controller/Action/


$ php ./tests/QuickForm2/Controller/Action/AllTests.php

both of these will run the suite once. Removing "the whole stuff" will,
however, prevent the second form of invocation from running.


[2011-11-15 03:11:05] danielc

An example of a problem caused by the second running...

phpunit -d error_reporting=22527

1) HTML_QuickForm2_Controller_Action_JumpTest::testBug3443
Constant SID already defined


[2011-11-14 22:50:21] danielc


When calling "phpunit -d error_reporting=22527 tests/AllTests" the tests
execute twice. This is due to the use of
"PHPUnit_TextUI_TestRunner::run(self::suite());" in main(). Commenting
out that line fixes the issue.

The whole main() / PHPUnit_MAIN_METHOD stuff is unnecessary. I imagine
that's left over from very old versions of PHPUnit.

The running 2x becomes a problem because during the second round, the
63rd test causes a hang.




Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedDec 10, '11 at 4:24p
activeDec 10, '11 at 4:24p

1 user in discussion

Danielc: 1 post



site design / logo © 2022 Grokbase