public function testEnd() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $conn = new Stream($stream, $loop); $conn->end(); $this->assertFalse(is_resource($stream)); }