コード例 #1
0
ファイル: StreamTest.php プロジェクト: WarToaster/HangOn
 public function testWriteAndRead()
 {
     $stream = new Stream($this->_testConfig);
     $this->assertTrue(is_resource($stream->open()));
     $this->assertTrue(is_resource($stream->resource()));
     $result = $stream->write();
     $this->assertEqual(83, $result);
     $this->assertPattern("/^HTTP/", (string) $stream->read());
 }
コード例 #2
0
ファイル: StreamTest.php プロジェクト: unionofrad/lithium
 public function testWriteAndRead()
 {
     $stream = new Stream($this->_testConfig);
     $this->assertInternalType('resource', $stream->open());
     $this->assertInternalType('resource', $stream->resource());
     $result = $stream->write();
     $this->assertEqual(84, $result);
     $this->assertPattern("/^HTTP/", (string) $stream->read());
 }
コード例 #3
0
ファイル: StreamTest.php プロジェクト: EHER/chegamos
 public function testEncoding()
 {
     $stream = new Stream($this->_testConfig);
     $result = $stream->open();
     $stream->encoding('UTF-8');
     $result = $stream->resource();
     $this->assertTrue(is_resource($result));
     $stream = new Stream($this->_testConfig + array('encoding' => 'UTF-8'));
     $result = $stream->open();
     $result = $stream->resource();
     $this->assertTrue(is_resource($result));
 }