Author: Victor Farazdagi
Inheritance: implements Phrozn\Outputter
 public function testStdErrWithResource()
 {
     $fp = fopen('/tmp/stderr', 'w+');
     define('STDERR', $fp);
     fclose($fp);
     $outputter = new Outputter();
     $outputter->stderr('sending output', '');
     $this->assertSame('sending output', trim(file_get_contents('/tmp/stderr')));
 }
Example #2
0
 public function testStdErrWithResource()
 {
     $fp = tmpfile();
     define('STDERR', $fp);
     $outputter = new Outputter();
     $outputter->stderr('sending output', '');
     rewind($fp);
     $contents = fread($fp, 8096);
     fclose($fp);
     $this->assertSame('sending output', trim($contents));
 }