|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / dev2.destoffenstraat.com / vendor / ezimuel / guzzlestreams / tests / |
Filename | /home/dev2.destoffenstraat.com/vendor/ezimuel/guzzlestreams/tests/NullStreamTest.php |
Size | 1.12 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 17-Aug-2025 10:26 |
Last modified | 24-Oct-2022 14:58 |
Last accessed | 21-Aug-2025 17:01 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace GuzzleHttp\Tests\Stream;
use GuzzleHttp\Stream\Exception\CannotAttachException;
use GuzzleHttp\Stream\NullStream;
use PHPUnit\Framework\TestCase;
class NullStreamTest extends 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();
}
public function testCannotAttach()
{
$this->expectException(CannotAttachException::class);
$p = new NullStream();
$p->attach('a');
}
}
namespace GuzzleHttp\Tests\Stream;
use GuzzleHttp\Stream\Exception\CannotAttachException;
use GuzzleHttp\Stream\NullStream;
use PHPUnit\Framework\TestCase;
class NullStreamTest extends 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();
}
public function testCannotAttach()
{
$this->expectException(CannotAttachException::class);
$p = new NullStream();
$p->attach('a');
}
}