atoum/atoum

Echoing in afterTestMethod leads to error

Closed this issue · 1 comments

I have a test class where I am testing the functionality of beforeTestMethod and afterTestMethod

public function beforeTestMethod($method) {

    echo "start\n";
}


public function afterTestMethod($method) {

    echo "end\n";
}

The beforeTestMethod works OK, buth the afterTestMethod leads to failure:

> There are 4 uncompleted methods:
=> tests\units\App\Util\Calculator::testAdd() with exit code 0:
==> output(1068) "end
O:26:"mageekguy\atoum\test\score":15:{s:32:" mageekguy\atoum\test\score case";N;s:38:" mageekguy\atoum\test\score dataSetKey";N;s:43:" mageekguy\atoum\test\score dataSetProvider";N;s:13:" * passNumber";i:2;s:17:" * failAssertions";a:0:{}s:13:" * exceptions";a:0:{}s:20:" * runtimeExceptions";a:0:{}s:9:" * errors";a:0:{}s:10:" * outputs";a:1:{i:0;a:3:{s:5:"class";s:31:"tests\units\App\Util\Calculator";s:6:"method";s:7:"testAdd";s:5:"value";s:6:"start
";}}s:12:" * durations";a:1:{i:0;a:4:{s:5:"class";s:31:"tests\units\App\Util\Calculator";s:6:"method";s:7:"testAdd";s:5:"value";d:0.002000093460083008;s:4:"path";s:69:"C:\Users\Jano\Documents\php-progs\atoum\tests\App\Util\Calculator.php";}}s:15:" * memoryUsages";a:1:{i:0;a:3:{s:5:"class";s:31:"tests\units\App\Util\Calculator";s:6:"method";s:7:"testAdd";s:5:"value";i:16832;}}s:14:" * voidMethods";a:0:{}s:21:" * uncompletedMethods";a:0:{}s:17:" * skippedMethods";a:0:{}s:11:" * coverage";C:30:"mageekguy\atoum\score\coverage":76:{a:7:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}i:4;a:0:{}i:5;a:0:{}i:6;a:0:{}}}}"
=> tests\units\App\Util\Calculator::testSub() with exit code 0:

Hi @janbodnar

I opened #876 to propose a fix for this issue.