blob: 8e41431592ec2143c2491650a920f8058cdfb47d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
namespace GuzzleHttp\Tests\Stream;
use GuzzleHttp\Stream\NullStream;
class NullStreamTest extends \PHPUnit_Framework_TestCase
{
public function testDoesNothing()
{
$b = new NullStream();
$this->assertEquals('', $b->read(10));
$this->assertEquals(4, $b->write('test'));
$this->assertEquals('', (string) $b);
$this->assertNull($b->getMetadata('a'));
$this->assertEquals([], $b->getMetadata());
$this->assertEquals(0, $b->getSize());
$this->assertEquals('', $b->getContents());
$this->assertEquals(0, $b->tell());
$this->assertTrue($b->isReadable());
$this->assertTrue($b->isWritable());
$this->assertTrue($b->isSeekable());
$this->assertFalse($b->seek(10));
$this->assertTrue($b->eof());
$b->detach();
$this->assertTrue($b->eof());
$b->close();
}
/**
* @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
*/
public function testCannotAttach()
{
$p = new NullStream();
$p->attach('a');
}
}
|