コード例 #1
0
ファイル: StreamTest.php プロジェクト: kaiwa/http
 /**
  * Method to test close().
  *
  * @return void
  *
  * @covers Asika\Http\Stream::close
  */
 public function testClose()
 {
     $this->createTempFile();
     $resource = fopen($this->tmpnam, Stream::MODE_READ_WRITE_RESET);
     $stream = new Stream($resource);
     $stream->write('Foo Bar');
     $stream->close();
     $this->assertFalse(is_resource($resource));
     $this->assertAttributeEmpty('resource', $stream);
     $this->assertEquals('', (string) $stream);
 }