Lines Matching refs:p
14 $p = new PumpStream(function () {}, [
19 $this->assertEquals('bar', $p->getMetadata('foo'));
20 $this->assertEquals(['foo' => 'bar'], $p->getMetadata());
21 $this->assertEquals(100, $p->getSize());
26 $p = Stream::factory(function ($size) {
29 $this->assertEquals('a', $p->read(1));
30 $this->assertEquals(1, $p->tell());
31 $this->assertEquals('aaaaa', $p->read(5));
32 $this->assertEquals(6, $p->tell());
38 $p = Stream::factory(function ($size) use (&$called) {
42 $this->assertEquals('a', $p->read(1));
43 $this->assertEquals('b', $p->read(1));
44 $this->assertEquals('cdef', $p->read(4));
45 $this->assertEquals('abcdefabc', $p->read(9));
51 $p = Stream::factory(function () { return 'a'; });
52 $s = new LimitStream($p, 5);
58 $p = Stream::factory(function () {});
59 $this->assertTrue($p->isReadable());
60 $this->assertFalse($p->isSeekable());
61 $this->assertFalse($p->isWritable());
62 $this->assertNull($p->getSize());
63 $this->assertFalse($p->write('aa'));
64 $this->assertEquals('', $p->getContents());
65 $this->assertEquals('', (string) $p);
66 $p->close();
67 $this->assertEquals('', $p->read(10));
68 $this->assertTrue($p->eof());
74 $p = Stream::factory(function () {});
75 $p->attach('a');