FAQ
Edit report at http://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: Open
Type: Bug
Package: HTML_QuickForm2
Package Version: SVN
PHP Version: 5.4.0alpha1
Roadmap Versions:
New Comment:

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

phpunit -d error_reporting=22527
./tests/QuickForm2/Controller/Action/AllTests.php

1) HTML_QuickForm2_Controller_Action_JumpTest::testBug3443
Constant SID already defined


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

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

Description:
------------
Hi:

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.

Thanks,

--Dan

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

Search Discussions

  • Borz_off at Nov 15, 2011 at 9:45 am
    Edit report at http://pear.php.net/bugs/bug.php?id=19038&edit=1

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

    -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/

    or

    $ 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.


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

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

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

    phpunit -d error_reporting=22527
    ./tests/QuickForm2/Controller/Action/AllTests.php

    1) HTML_QuickForm2_Controller_Action_JumpTest::testBug3443
    Constant SID already defined

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

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

    Description:
    ------------
    Hi:

    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.

    Thanks,

    --Dan

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 15, '11 at 2:12a
activeNov 15, '11 at 9:45a
posts2
users2
websitepear.php.net

2 users in discussion

Borz_off: 1 post Danielc: 1 post

People

Translate

site design / logo © 2022 Grokbase