/** * Creates instance and redirects STDOUT to temporary file */ public function setUp() { $this->_mockFile = tempnam(sys_get_temp_dir(), 'temp'); $resource = fopen($this->_mockFile, 'wb'); Streams::setStream('out', $resource); $this->_instance = new Table(); $this->_instance->setRenderer(new Ascii()); }
private function resetStreams() { \cli\Streams::setStream("out", tmpfile()); \cli\Streams::setStream("err", tmpfile()); }