shredding
shredding

Reputation: 5591

Interpreting PHP Unit output

My PHP Unit outputs this on the console. What exactly does 63/129 ( 48%) and the thing in general mean? Does it run all tests or not?

PHPUnit 3.7.22 by Sebastian Bergmann.

Configuration read from phpunit.xml

...............................................................  63 / 129 ( 48%)
............................................................... 126 / 129 ( 97%)
...

Time: 0 seconds, Memory: 6.75Mb

OK (129 tests, 245 assertions)

The phpunit.xml looks like:

<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="vendor/autoload.php">

    <testsuites>
        <testsuite name="SDK Testsuite">
            <directory suffix="Test.php">src/MyNamespace/Test/Unit</directory>
        </testsuite>
    </testsuites>

</phpunit>

Upvotes: 8

Views: 2710

Answers (2)

jake_feyereisen
jake_feyereisen

Reputation: 739

Each dot represents a successfully completed test. Other outputted symbols include 'I', 'S', 'R', 'F', and 'E'.

An 'I' is produced when the test includes the line

$this->markTestIncomplete('Your reason for being incomplete string');

An 'S' is produced when the test includes the line

$this->markTestSkipped('Your reason for skipping string');

An 'R' is produced when the test is risky in some fashion i.e. does not perform any assertions.

An 'E' is produced when phpunit encounters an error during the test execution, and an 'F' is produced when an assertion in the test being executed fails.

Upvotes: 6

JJJ
JJJ

Reputation: 33163

Each dot represents one unit test. It prints one dot after running each test. The first line has 63 dots, which means 63 out of 129 tests (that's about 48%) have been run. The second line has another 63 dots which brings the total to 126 tests. The last three tests are on the third line.

The feature is meant for when tests take a long time and you can follow the progress on the screen. It's also useful if one of the tests puts the system into a deadlock. The progress meter lets you see which one is the problematic test.

Upvotes: 8

Related Questions