Exemplo n.º 1
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage Cannot write to a non-writable stream
  */
 public function testHandlesClose()
 {
     $s = Psr7\stream_for('foo');
     $wrapped = new NoSeekStream($s);
     $wrapped->close();
     $wrapped->write('foo');
 }
Exemplo n.º 2
0
 /**
  * @expectedException \RuntimeException
  */
 public function testCalculatesHashThrowsWhenSeekFails()
 {
     $s = new NoSeekStream(Psr7\stream_for('foobazbar'));
     $s->read(2);
     Psr7\hash($s, 'md5');
 }