React\Tests\Stream\BufferTest::testWriteEmitsErrorWhenResourceIsNotWritable PHP Метод

testWriteEmitsErrorWhenResourceIsNotWritable() публичный Метод

    public function testWriteEmitsErrorWhenResourceIsNotWritable()
    {
        if (defined('HHVM_VERSION')) {
            // via https://github.com/reactphp/stream/pull/52/files#r75493076
            $this->markTestSkipped('HHVM allows writing to read-only memory streams');
        }
        $stream = fopen('php://temp', 'r');
        $loop = $this->createLoopMock();
        $buffer = new Buffer($stream, $loop);
        $buffer->on('error', $this->expectCallableOnce());
        //$buffer->on('close', $this->expectCallableOnce());
        $buffer->write('hello');
        $buffer->handleWrite();
    }