Given the following PHPUnit code, how do I translate this to a phpspec test?
$content = 'Hello world!';
ob_start();
$this->displayer->output($content);
$output = ob_get_clean();
$this->assertEquals($content, $output);
What $this->displayer->output($content) does is simply echo the $content:
class Displayer {
public function display(string $content) { echo $content; }
}
I believe this is the only way: