Ejemplo n.º 1
0
 public function testHandlesClose()
 {
     $s = puzzle_stream_Stream::factory('foo');
     $wrapped = new puzzle_stream_NoSeekStream($s);
     $wrapped->close();
     $this->assertFalse($wrapped->write('foo'));
 }
Ejemplo n.º 2
0
 /**
  * @expectedException puzzle_stream_exception_SeekException
  */
 public function testCalculatesHashThrowsWhenSeekFails()
 {
     $s = new puzzle_stream_NoSeekStream(puzzle_stream_Stream::factory('foobazbar'));
     $s->read(2);
     puzzle_stream_Utils::hash($s, 'md5');
 }