public function testMessageCode()
 {
     $this->consumer->connect();
     $this->consumer->writeInt2(1);
     $this->consumer->rewind();
     $this->assertEquals(1, $this->consumer->getResponseCode());
 }
Esempio n. 2
0
 /**
  * @expectedException Kafka_Exception_Socket
  */
 public function testConnectFailure()
 {
     $producer = new Kafka_Producer('invalid-host-name', 1234567890, Kafka_Encoder::COMPRESSION_NONE);
     $producer->connect();
     $this->fail('The above call should throw an exception');
 }