예제 #1
0
 public function testCloseClearProperties()
 {
     $handle = fopen('php://temp', 'r+');
     $stream = new Stream($handle);
     $stream->close();
     $this->assertFalse($stream->isSeekable());
     $this->assertFalse($stream->isReadable());
     $this->assertFalse($stream->isWritable());
     $this->assertNull($stream->getSize());
     $this->assertEmpty($stream->getMetadata());
 }
예제 #2
0
 /**
  * Close the file stream
  */
 public function close()
 {
     $this->stream->close();
 }
예제 #3
0
 /**
  * Get a File's Content.
  *
  * @param mixed $file File Location or Resource
  *
  * @return string File Contents
  */
 protected function getFileContents($file)
 {
     if (!is_resource($file)) {
         $file = fopen($file, 'r');
     }
     $stream = new Stream($file);
     $output = $stream->getContents();
     $stream->close();
     return $output;
 }
 public function tearDown()
 {
     $this->decorated->close();
     $this->body->close();
 }