React\Stream\Buffer::isWritable PHP Method

isWritable() public method

public isWritable ( )
    public function isWritable()
    {
        return $this->writable;
    }

Usage Example

Example #1
0
 /**
  * @covers React\Stream\Buffer::isWritable
  * @covers React\Stream\Buffer::close
  */
 public function testClose()
 {
     $stream = fopen('php://temp', 'r+');
     $loop = $this->createLoopMock();
     $buffer = new Buffer($stream, $loop);
     $buffer->on('error', $this->expectCallableNever());
     $buffer->on('close', $this->expectCallableOnce());
     $this->assertTrue($buffer->isWritable());
     $buffer->close();
     $this->assertFalse($buffer->isWritable());
 }