I have some classes I am writing unit tests for which have echoes in them. I want to suppress this output and thought ob_start()
and ob_clean()
would suffice, but they aren't having an effect.
public function testSomething (){
ob_start();
$class = new MyClass();
$class->method();
ob_clean();
}
I've also tried variations such as ob_start(false, 0, true);
and ob_end_clean()
to no avail.
What am I missing?