Skip to content

PHPUnit_TextUI_TestRunner::run() missing exit parameter #2286

@Starli0n

Description

@Starli0n

Hi,

I tried to run some tests manually for debug purpose. I do something like:

class MyClassTest extends \PHPUnit_Framework_TestCase
{
    public static function main()
    {
        $Suite = new \PHPUnit_Framework_TestSuite('MyClassTest');
        \PHPUnit_TextUI_TestRunner::run($Suite);
        unset($Suite);
    }

and in debug.php, I call MyClassTest::main(); but I cannot chain other test suites as the run function is called with $exit = true in the doRun() function.

It would be good to have this parameter in the call like:
vendor/phpunit/phpunit/src/TextUI/TestRunner.php

    public static function run($test, array $arguments = [], $exit = true)
    (...)
            return $aTestRunner->doRun(
                $test,
                $arguments,
                $exit,
            );

So that it is transmitted to the doRun() function, so chaining tests could be possible

MyClassTest::main();
MyClass1Test::main(); // Never reached as $exit = true by default

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementA new idea that should be implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions