testPrint(); } public function testPrint() { ob_start(); $cliOutput = new CliPrintOutput(5, function ($dumped) { echo $dumped; }); $cliOutput->print("Hello, world!"); $output = ob_get_clean(); $this->assertEquals('(string) "Hello, world!"'.PHP_EOL, $output); } }