NoSeekStreamTest.php in Zircon Profile 8
File
vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php
View source
<?php
namespace GuzzleHttp\Tests\Psr7;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\NoSeekStream;
class NoSeekStreamTest extends \PHPUnit_Framework_TestCase {
public function testCannotSeek() {
$s = $this
->getMockBuilder('Psr\\Http\\Message\\StreamInterface')
->setMethods([
'isSeekable',
'seek',
])
->getMockForAbstractClass();
$s
->expects($this
->never())
->method('seek');
$s
->expects($this
->never())
->method('isSeekable');
$wrapped = new NoSeekStream($s);
$this
->assertFalse($wrapped
->isSeekable());
$wrapped
->seek(2);
}
public function testHandlesClose() {
$s = Psr7\stream_for('foo');
$wrapped = new NoSeekStream($s);
$wrapped
->close();
$wrapped
->write('foo');
}
}