Lines Matching +full:s +full:- +full:tell

24         $this->decorated = Stream::factory('testing');
25 $this->body = new CachingStream($this->decorated);
30 $this->decorated->close();
31 $this->body->close();
38 $this->assertEquals(4, $caching->getSize());
43 $this->expectException(RuntimeException::class);
44 $this->expectErrorMessage('Cannot seek to byte 10');
45 $this->body->seek(10);
50 $this->assertFalse($this->body->seek(2, SEEK_END));
56 $d = $this->getMockBuilder('GuzzleHttp\Stream\CachingStream')
57 ->setConstructorArgs(array($a))
58 ->getMock();
59 $d->expects($this->once())
60 ->method('seek')
61 ->with(0)
62 ->will($this->returnValue(true));
63 $d->seek(0);
68 $this->assertEquals('te', $this->body->read(2));
69 $this->body->seek(0);
70 $this->assertEquals('test', $this->body->read(4));
71 $this->assertEquals(4, $this->body->tell());
72 $this->body->seek(2);
73 $this->assertEquals(2, $this->body->tell());
74 $this->body->seek(2, SEEK_CUR);
75 $this->assertEquals(4, $this->body->tell());
76 $this->assertEquals('ing', $this->body->read(3));
81 $this->body->read(2);
82 $this->body->write('hi');
83 $this->body->seek(0);
84 $this->assertEquals('tehiing', (string) $this->body);
98 $skipReadBytes->setAccessible(true);
100 $this->assertEquals("0000\n", Utils::readline($body));
101 $this->assertEquals("0001\n", Utils::readline($body));
103 $this->assertEquals(5, $body->write("TEST\n"));
104 $this->assertEquals(5, $skipReadBytes->getValue($body));
106 $this->assertEquals("0003\n", Utils::readline($body));
107 $this->assertEquals(0, $skipReadBytes->getValue($body));
108 $this->assertEquals("0004\n", Utils::readline($body));
109 $this->assertEquals("0005\n", Utils::readline($body));
112 $body->seek(5);
113 $this->assertEquals(5, $body->write("ABCD\n"));
114 $this->assertEquals(0, $skipReadBytes->getValue($body));
115 $this->assertEquals("TEST\n", Utils::readline($body));
116 $this->assertEquals("0003\n", Utils::readline($body));
117 $this->assertEquals("0004\n", Utils::readline($body));
118 $this->assertEquals("0005\n", Utils::readline($body));
119 $this->assertEquals("0006\n", Utils::readline($body));
120 $this->assertEquals(5, $body->write("1234\n"));
121 $this->assertEquals(5, $skipReadBytes->getValue($body));
124 $body->seek(0);
125 …$this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50…
128 …$this->assertStringContainsString("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", …
133 $s = fopen('php://temp', 'r');
134 $a = Stream::factory($s);
136 $d->close();
137 $this->assertFalse(is_resource($s));