\Grpc\STATUS_OK, 'details' => 'OK', ]; $return = \Grpc\Status::ok(); $this->assertEquals($status, $return); } public function testStatusOkWithMetadata() { $status = [ 'code' => \Grpc\STATUS_OK, 'details' => 'OK', 'metadata' => ['a' => 1], ]; $return = \Grpc\Status::ok(['a' => 1]); $this->assertEquals($status, $return); } public function testStatusUnimplemented() { $status = [ 'code' => \Grpc\STATUS_UNIMPLEMENTED, 'details' => 'UNIMPLEMENTED', ]; $return = \Grpc\Status::unimplemented(); $this->assertEquals($status, $return); } public function testStatus() { $status = [ 'code' => \Grpc\STATUS_INVALID_ARGUMENT, 'details' => 'invalid argument', ]; $return = \Grpc\Status::status( \Grpc\STATUS_INVALID_ARGUMENT, "invalid argument" ); $this->assertEquals($status, $return); } public function testStatusWithMetadata() { $status = [ 'code' => \Grpc\STATUS_INVALID_ARGUMENT, 'details' => 'invalid argument', 'metadata' => ['trailiingMeta' => 100] ]; $return = \Grpc\Status::status( \Grpc\STATUS_INVALID_ARGUMENT, "invalid argument", ['trailiingMeta' => 100] ); $this->assertEquals($status, $return); } }