* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tests\Output; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\StreamOutput; class StreamOutputTest extends TestCase { protected $stream; protected function setUp() { $this->stream = fopen('php://memory', 'a', false); } protected function tearDown() { $this->stream = null; } public function testConstructor() { $output = new StreamOutput($this->stream, Output::VERBOSITY_QUIET, true); $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument'); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The StreamOutput class needs a stream as its first argument. */ public function testStreamIsRequired() { new StreamOutput('foo'); } public function testGetStream() { $output = new StreamOutput($this->stream); $this->assertEquals($this->stream, $output->getStream(), '->getStream() returns the current stream'); } public function testDoWrite() { $output = new StreamOutput($this->stream); $output->writeln('foo'); rewind($output->getStream()); $this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream'); } } __halt_compiler();----SIGNATURE:----wDeSydYtC4QDUtlcxfh71RdoHEVi3Wx4NpwgrXk4UcSv9xMCJRm83qbNvtbEuBi7nQgynbos5Fpu81EqnLXmb5+WpGcxDD3SnMAbmDJ7AxS1abDhWBBmFbLQEh3RBDT4d6wSFEhxywcWDMBH9FxPd/Fuk5lyDxxCj5+23sBtqYkVfmOjrlz1fDHmFbv6ZkA0G4cOkgz3LqUDoTaxySYcZoDUSl1xCEi/XEQTJ8Xp/iCaH6K5ZFkgeh7XuJHC7ynMsD8qD30GuDy377P26FakoTi6Jh675bMZBspephowT+PBeggUc8XboWYXlpJqfBak41lVHC1Qo3IdZju44GEUhQULk6cV//o2mj8KSZEgx6kq3dXa9CWGjbzenC+toM9fm8A0lqwbrf8n55i8lNdSthlFIunk1HR92DMhfHV1VGBGt6rSmJ8E/7vHjYjZ7JEt7nWdzDn2SC83qBq2eYp51TX3iU8lCVsUUN/B6cSxHPbMMIK/aTBt/fsWrP0JW98LurIIxhD3UDJ1MzAeo6gKOjg3a3gcSEYgJMNGlxttN8XeFLDHeIn+sWgaAIfbwsW3R4PYrPBf726PBICU0mHFpSEWVhpdCGeHVQjExnkxmXtqsXkMcfcgocevq5It9fm/Q8sJspASNox5iM+Lgs4M2cFCOpIxg25fRVTM/hahZyc=----ATTACHMENT:----NzI4ODIzNTc4MzM1Njc1MyAxMDIyMDc3NjQ4NDA4Njk1IDkyNTgxMzc3NTEyMDE5MzA=