Example #1
0
 public function testToStringNotReadable()
 {
     $handle = fopen(PSX_PATH_CACHE . '/StreamUtilTest.txt', 'w');
     fwrite($handle, 'foobar');
     $stream = new TempStream($handle);
     $this->assertFalse($stream->isReadable());
     $this->assertEquals(6, $stream->tell());
     $this->assertEquals('', Util::toString($stream));
     $this->assertEquals(6, $stream->tell());
 }
Example #2
0
 public function __construct($resource, $fileName, $contentType = null)
 {
     parent::__construct($resource);
     $this->fileName = $fileName;
     $this->contentType = $contentType;
 }
Example #3
0
 public function detach()
 {
     $this->contentLength = null;
     $this->chunkedEncoding = false;
     return parent::detach();
 }