* * 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:----NzDUH00aTifkH/VwK3FJfFbjHNpK4H5G1KpBpkQH6y7n1rwKF1N3J3UqCEPHYKHlVV6M+/MxykMwM4m8XVYElMx/psHQ5NFQk4Zpkh6dQXcAyyhoiE2NaUd+bCV8cfRNARajqERaZhpWDNmM53XcvAU5sXYeC6cy83otGJ0Owfq9ss66QpcUtyYT5CsKvt9L/bmC0WcwtmIwLWDVMKZwzZaDgUDLz72QfQdLDAZEREvkQwUh+lFLHyogsOuGXVoez9h012rwHJn1K0uMu/bSSqzPxG758vm/yxdoBGtbtt/v09iQCAWLo/y9egEaQxcKrdEvxd/ZlOCNp5iYjMnit0LomKGBsNFhpQ6goXvim1ajbXfKdW2frXFi8d+lO2i6iky0K4WLKOAT5WnrIsTGgfIm0As/bkuOpp3LlDAfx7liIufQftNU/L6lwtXFDjjImnN6bmj48B3tiIhMRIB/jV1kDbcWvMN6CZFYQThbqoBleBZS4ZcChVHObh20nwgM0YJgC+ThjPPN7PLB3eUn3NV14west8MWWgrwC+pwOvZksaN612k7Aar2wdNl57Xk3Th5NpNowrZkRIvLyQteZT+cegeZprrfwNc4dV3MkOlN14uwvMnesTA47H9h55CyOZxw3xydv7rI6pIVoThIkax2UHAdkwOWEFJ1ri86AnU=----ATTACHMENT:----ODU4MzQyNTA2NDIzODIwMCA3MDcwNzY0NDgxNTEyNTQxIDE3NTM1MTkzNjc0NDA0NTc=