Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interpreting PHP Unit output

Tags:

phpunit

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>
like image 532
shredding Avatar asked Aug 09 '13 08:08

shredding


2 Answers

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.

like image 79
JJJ Avatar answered Jan 02 '23 16:01

JJJ


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.

like image 29
jake_feyereisen Avatar answered Jan 02 '23 15:01

jake_feyereisen