/** * @param \google\protobuf\FieldDescriptorProto $field * * @return string */ protected function getFieldTypeName(FieldDescriptorProto $field) { $type = $field->getType()->value(); $name = Field::getTypeName($type); return $name ?: 'unknown'; }
/** * @dataProvider typeNameProvider */ public function testGetTypeName($type, $expected) { $this->assertEquals($expected, Field::getTypeName($type)); }