testReadfileImplementation(array(\eShims::class, 'readfile')); } public function testReadfileAlt() { $this->testReadfileImplementation(array(\eShims::class, 'readfile_alt')); } protected function testReadfileImplementation($implementation) { $tmp_handle = tmpfile(); $tmp_filename = stream_get_meta_data($tmp_handle)['uri']; $garbage = str_pad('', 16384, 'x'); fwrite($tmp_handle, $garbage); ob_start(); call_user_func($implementation, $tmp_filename); $output = ob_get_clean(); fclose($tmp_handle); $this->assertEquals($garbage, $output); } }