Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the S and W in PHPUnit's test output?

Tags:

php

phpunit

I recently updated the PHPUnit by Sebastian Bergmann and when I tried running the test cases, I got this as output:

...EEE.EEEEE.E.EE............EFFFE.F..FF.........SSSSSSSSSSSSSS  63 / 110 ( 57%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....W.W                 110 / 110 (100%)

According to the documentation, I could find that:

.   Success
E   Error
F   Failed

I am not sure what's W and S here. Can someone tell me what's that? If additional information helps, the W is in yellow colour and S is in blue colour.

like image 303
CodeWars Help Avatar asked Jan 03 '17 22:01

CodeWars Help


People also ask

What is assertion in PHPUnit?

PHPunit | assertEquals() Function The assertEquals() function is a builtin function in PHPUnit and is used to assert whether the actual obtained value is equals to expected value or not. This assertion will return true in the case if the expected value is the same as the actual value else returns false.

What is PHPUnit testing?

PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit design for unit testing systems that began with SUnit and became popular with JUnit. Even a small software development project usually takes hours of hard work.


1 Answers

According to the Docs:

.   Printed when the test succeeds.
F   Printed when an assertion fails while running the test method.
E   Printed when an error occurs while running the test method.
R   Printed when the test has been marked as risky (see Chapter 6).
S   Printed when the test has been skipped (see Chapter 7).
I   Printed when the test is marked as being incomplete or not yet implemented (see Chapter 7).

And according to the Source Code:

public function addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time)
{
    $this->writeProgressWithColor('fg-yellow, bold', 'W');
    $this->lastTestFailed = true;
}

The yellow bold W is for Warning. Hope this answers your question.

like image 86
Praveen Kumar Purushothaman Avatar answered Sep 18 '22 13:09

Praveen Kumar Purushothaman