Lines Matching refs:body
17 protected $body;
25 $this->body = new LimitStream($this->decorated, 10, 3);
30 $body = new LimitStream(Stream::factory('foo'), -1, 1);
31 $this->assertEquals('oo', (string) $body);
32 $this->assertTrue($body->eof());
33 $body->seek(0);
34 $this->assertFalse($body->eof());
35 $this->assertEquals('oo', $body->read(100));
36 $this->assertEmpty($body->read(1));
37 $this->assertTrue($body->eof());
42 $body = Stream::factory('foo_baz_bar');
43 $limited = new LimitStream($body, 3, 4);
49 $body = Stream::factory('');
50 $limited = new LimitStream($body, 0, 10);
56 $this->assertEquals(0, $this->body->tell());
62 $this->assertEquals(true, $this->body->seek(100));
63 $this->assertEquals(10, $this->body->tell());
65 $this->assertEquals(true, $this->body->seek(0));
66 $this->assertEquals(0, $this->body->tell());
68 $this->assertEquals(false, $this->body->seek(-10));
69 $this->assertEquals(0, $this->body->tell());
71 $this->assertEquals(true, $this->body->seek(5));
72 $this->assertEquals(5, $this->body->tell());
74 $this->assertEquals(false, $this->body->seek(1000, SEEK_END));
79 $data = $this->body->read(100);
81 $this->assertFalse($this->body->read(1000));
83 $this->body->setOffset(10);
84 $newData = $this->body->read(100);
102 $this->assertFalse($this->body->eof());
103 $this->body->read(1000);
104 $this->assertTrue($this->body->eof());
109 $this->assertEquals(10, $this->body->getSize());
114 $body = new LimitStream(Stream::factory('foobazbar'), 3, 3);
115 $this->assertEquals('baz', $body->getContents());