~ancarda/psr7-string-stream

ref: 613485cfa5ed04fe26f6b60807209e098a97ca87 psr7-string-stream/tests/IllegalOperationExceptionTest.php -rw-r--r-- 599 bytes
613485cfMark Dain Throw StreamUnusableException after close/detach 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

declare(strict_types=1);

namespace Tests;

use Ancarda\Psr7\StringStream\IllegalOperationException;
use PHPUnit\Framework\TestCase;

class IllegalOperationExceptionTest extends TestCase
{
    public function testException(): void
    {
        $exception = new IllegalOperationException('write', 'read-only');
        static::assertSame(0, $exception->getCode());
        static::assertSame(
            "You cannot call `write' on this stream because it's read-only.",
            $exception->getMessage()
        );
        static::assertSame('write', $exception->getOperation());
    }
}