/** * {@inheritdoc} */ public function close($code = 1000) { if ($code instanceof DataInterface) { $this->send($code); } else { $this->send(new Frame(Frame::encode(sprintf('%016b', $code)), true, Frame::OP_CLOSE)); } $this->getConnection()->close(); }
/** * @dataProvider maskingKeyProvider * @todo I I wrote the dataProvider incorrectly, skpping for now */ public function testGetMaskingKey($mask) { $this->_frame->addBuffer(Frame::encode($this->_firstByteFinText)); $this->_frame->addBuffer(Frame::encode($this->_secondByteMaskedSPL)); $this->_frame->addBuffer($mask); $this->assertEquals($mask, $this->_frame->getMaskingKey()); }