Lines Matching refs:this

24         $this->decorated = Stream::factory(fopen(__FILE__, 'r'));
25 $this->body = new LimitStream($this->decorated, 10, 3);
31 $this->assertEquals('oo', (string) $body);
32 $this->assertTrue($body->eof());
34 $this->assertFalse($body->eof());
35 $this->assertEquals('oo', $body->read(100));
36 $this->assertEmpty($body->read(1));
37 $this->assertTrue($body->eof());
44 $this->assertEquals('baz', (string) $limited);
51 $this->assertEquals('', (string) $limited);
56 $this->assertEquals(0, $this->body->tell());
57 $this->assertEquals(3, $this->decorated->tell());
62 $this->assertEquals(true, $this->body->seek(100));
63 $this->assertEquals(10, $this->body->tell());
64 $this->assertEquals(13, $this->decorated->tell());
65 $this->assertEquals(true, $this->body->seek(0));
66 $this->assertEquals(0, $this->body->tell());
67 $this->assertEquals(3, $this->decorated->tell());
68 $this->assertEquals(false, $this->body->seek(-10));
69 $this->assertEquals(0, $this->body->tell());
70 $this->assertEquals(3, $this->decorated->tell());
71 $this->assertEquals(true, $this->body->seek(5));
72 $this->assertEquals(5, $this->body->tell());
73 $this->assertEquals(8, $this->decorated->tell());
74 $this->assertEquals(false, $this->body->seek(1000, SEEK_END));
79 $data = $this->body->read(100);
80 $this->assertEquals(10, strlen($data));
81 $this->assertFalse($this->body->read(1000));
83 $this->body->setOffset(10);
84 $newData = $this->body->read(100);
85 $this->assertEquals(10, strlen($newData));
86 $this->assertNotSame($data, $newData);
91 $this->expectException(SeekException::class);
92 $this->expectExceptionMessage('Could not seek the stream to position 2');
102 $this->assertFalse($this->body->eof());
103 $this->body->read(1000);
104 $this->assertTrue($this->body->eof());
109 $this->assertEquals(10, $this->body->getSize());
115 $this->assertEquals('baz', $body->getContents());
125 $this->assertNull($b->getSize());
132 $this->assertEquals(3, $b->getSize());