2
namespace GuzzleHttp\Tests\Stream;
4
use GuzzleHttp\Stream\Stream;
5
use GuzzleHttp\Stream\NoSeekStream;
8
* @covers GuzzleHttp\Stream\NoSeekStream
9
* @covers GuzzleHttp\Stream\StreamDecoratorTrait
11
class NoSeekStreamTest extends \PHPUnit_Framework_TestCase
13
public function testCannotSeek()
15
$s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
16
->setMethods(['isSeekable', 'seek'])
17
->getMockForAbstractClass();
18
$s->expects($this->never())->method('seek');
19
$s->expects($this->never())->method('isSeekable');
20
$wrapped = new NoSeekStream($s);
21
$this->assertFalse($wrapped->isSeekable());
22
$this->assertFalse($wrapped->seek(2));
25
public function testHandlesClose()
27
$s = Stream::factory('foo');
28
$wrapped = new NoSeekStream($s);
30
$this->assertFalse($wrapped->write('foo'));