/** * @expectedException InvalidArgumentException */ public function testSendInvalidTypeString() { $client = new Client('ws://localhost/test', 'http://example.org/'); $client->sendData('blah', 'fooey'); }
public function fetchSocket($url) { $hosts = $this->di->get('config')->websocketd->hosts->toArray(); shuffle($hosts); $host = reset($hosts); $instance = new Client($host, 'http://www.shopbigbang.com/'); $success = $instance->connect(); $bytes = $instance->sendData($url, Protocol::TYPE_TEXT); $responses = $instance->receive(); $instance->disconnect(); return (string) reset($responses); }