/**
  * @covers Brickoo\Component\IO\Printing\BufferedPrinter::doPrint
  * @covers Brickoo\Component\IO\Printing\StreamBufferedPrinter::getStreamWriter
  */
 public function testStreamWriteResourceIsRefreshed()
 {
     $stream = new FileStream(new FileStreamConfig("php://memory", FileStream::MODE_READ + FileStream::MODE_WRITE));
     $streamPrinter = new StreamBufferedPrinter($stream, strlen("test"));
     $streamPrinter->doPrint("test");
     $streamPrinter->doPrint("Case");
     $streamPrinter->flushBuffer();
     fseek($stream->open(), 0);
     $this->assertSame("testCase", fgets($stream->open()));
     $stream->close();
 }
 /** @covers Brickoo\Component\IO\Stream\FileStream::reconfigure */
 public function testFileStreamReconfiguration()
 {
     $config_1 = $this->getFileStreamConfigurationFixture();
     $config_2 = $this->getFileStreamConfigurationFixture();
     $fileStream = new FileStream($config_1);
     $this->assertSame($config_1, $fileStream->getConfiguration());
     $this->assertSame($fileStream, $fileStream->reconfigure($config_2));
     $this->assertSame($config_2, $fileStream->getConfiguration());
 }