I have a code to test:
class ToTest
{
public function testMe()
{
echo 'test';
}
}
class TestTest extends \PHPUnit\Framework\TestCase
{
public function testX()
{
ob_start();
(new ToTest())->testMe();
$c = ob_get_clean();
$this->assertSame('test', $c);
}
}
this passes but marked as risky test:
Test code or tested code did not (only) close its own output buffers
to me, it looks I handled output buffering well...