Exemplo n.º 1
0
 public function recv_testInsanity()
 {
     $bin_accel = $this->input_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_read_binary');
     if ($bin_accel) {
         $result = thrift_protocol_read_binary($this->input_, '\\ThriftTest\\ThriftTest_testInsanity_result', $this->input_->isStrictRead());
     } else {
         $rseqid = 0;
         $fname = null;
         $mtype = 0;
         $this->input_->readMessageBegin($fname, $mtype, $rseqid);
         if ($mtype == TMessageType::EXCEPTION) {
             $x = new TApplicationException();
             $x->read($this->input_);
             $this->input_->readMessageEnd();
             throw $x;
         }
         $result = new \ThriftTest\ThriftTest_testInsanity_result();
         $result->read($this->input_);
         $this->input_->readMessageEnd();
     }
     if ($result->success !== null) {
         return $result->success;
     }
     throw new \Exception("testInsanity failed: unknown result");
 }
Exemplo n.º 2
0
 public function testInsanity_Read()
 {
     $this->transport->write(TestTJSONProtocol_Fixtures::$testArgsJSON['testInsanity']);
     $result = new \ThriftTest\ThriftTest_testInsanity_result();
     $result->read($this->protocol);
     $actual = $result->success;
     $expected = Fixtures::$testArgs['testInsanityExpectedResult'];
     $this->assertEquals($expected, $actual);
 }