use of com.google.api.codegen.util.php.PhpTypeTable in project toolkit by googleapis.
the class PhpModelTypeNameConverterTest method testNestedMessageFullNameWithPhpNamespace.
@Test
public void testNestedMessageFullNameWithPhpNamespace() {
String packageName = "Google\\Example\\Library\\V1";
TypeRef type = ModelTypeNameConverterTestUtil.getTestType("myproto", tempDir, "TopLevelMessage", "AnotherSubMessage");
PhpModelTypeNameConverter converter = new PhpModelTypeNameConverter(packageName);
PhpTypeTable typeTable = new PhpTypeTable(packageName);
TypeName typeName = converter.getTypeName(type);
assertThat(typeName.getFullName()).isEqualTo("\\Google\\Example\\MyProto\\V1\\TopLevelMessage\\AnotherSubMessage");
typeTable.getAndSaveNicknameFor(typeName);
assertThat(typeTable.getImports()).containsKey("\\Google\\Example\\MyProto\\V1\\TopLevelMessage\\AnotherSubMessage");
}
Aggregations