@@ -142,15 +142,17 @@ public function testFieldDescriptor()
142142 $ fieldDesc = $ fieldDescMap [1 ];
143143 $ this ->assertSame ('optional_int32 ' , $ fieldDesc ->getName ());
144144 $ this ->assertSame (1 , $ fieldDesc ->getNumber ());
145- $ this ->assertSame (self ::GPBLABEL_OPTIONAL , $ fieldDesc ->getLabel ());
145+ $ this ->assertFalse ($ fieldDesc ->isRequired ());
146+ $ this ->assertFalse ($ fieldDesc ->isRepeated ());
146147 $ this ->assertSame (self ::GPBTYPE_INT32 , $ fieldDesc ->getType ());
147148 $ this ->assertFalse ($ fieldDesc ->isMap ());
148149
149150 // Optional enum field
150151 $ fieldDesc = $ fieldDescMap [16 ];
151152 $ this ->assertSame ('optional_enum ' , $ fieldDesc ->getName ());
152153 $ this ->assertSame (16 , $ fieldDesc ->getNumber ());
153- $ this ->assertSame (self ::GPBLABEL_OPTIONAL , $ fieldDesc ->getLabel ());
154+ $ this ->assertFalse ($ fieldDesc ->isRequired ());
155+ $ this ->assertFalse ($ fieldDesc ->isRepeated ());
154156 $ this ->assertSame (self ::GPBTYPE_ENUM , $ fieldDesc ->getType ());
155157 $ this ->assertInstanceOf ('\Google\Protobuf\EnumDescriptor ' , $ fieldDesc ->getEnumType ());
156158 $ this ->assertFalse ($ fieldDesc ->isMap ());
@@ -159,7 +161,8 @@ public function testFieldDescriptor()
159161 $ fieldDesc = $ fieldDescMap [17 ];
160162 $ this ->assertSame ('optional_message ' , $ fieldDesc ->getName ());
161163 $ this ->assertSame (17 , $ fieldDesc ->getNumber ());
162- $ this ->assertSame (self ::GPBLABEL_OPTIONAL , $ fieldDesc ->getLabel ());
164+ $ this ->assertFalse ($ fieldDesc ->isRequired ());
165+ $ this ->assertFalse ($ fieldDesc ->isRepeated ());
163166 $ this ->assertSame (self ::GPBTYPE_MESSAGE , $ fieldDesc ->getType ());
164167 $ this ->assertInstanceOf ('\Google\Protobuf\Descriptor ' , $ fieldDesc ->getMessageType ());
165168 $ this ->assertFalse ($ fieldDesc ->isMap ());
@@ -168,15 +171,15 @@ public function testFieldDescriptor()
168171 $ fieldDesc = $ fieldDescMap [31 ];
169172 $ this ->assertSame ('repeated_int32 ' , $ fieldDesc ->getName ());
170173 $ this ->assertSame (31 , $ fieldDesc ->getNumber ());
171- $ this ->assertSame ( self :: GPBLABEL_REPEATED , $ fieldDesc ->getLabel ());
174+ $ this ->assertTrue ( $ fieldDesc ->isRepeated ());
172175 $ this ->assertSame (self ::GPBTYPE_INT32 , $ fieldDesc ->getType ());
173176 $ this ->assertFalse ($ fieldDesc ->isMap ());
174177
175178 // Repeated message field
176179 $ fieldDesc = $ fieldDescMap [47 ];
177180 $ this ->assertSame ('repeated_message ' , $ fieldDesc ->getName ());
178181 $ this ->assertSame (47 , $ fieldDesc ->getNumber ());
179- $ this ->assertSame ( self :: GPBLABEL_REPEATED , $ fieldDesc ->getLabel ());
182+ $ this ->assertTrue ( $ fieldDesc ->isRepeated ());
180183 $ this ->assertSame (self ::GPBTYPE_MESSAGE , $ fieldDesc ->getType ());
181184 $ this ->assertInstanceOf ('\Google\Protobuf\Descriptor ' , $ fieldDesc ->getMessageType ());
182185 $ this ->assertFalse ($ fieldDesc ->isMap ());
@@ -187,7 +190,8 @@ public function testFieldDescriptor()
187190 $ fieldDesc = $ fieldDescMap [51 ];
188191 $ this ->assertSame ('oneof_int32 ' , $ fieldDesc ->getName ());
189192 $ this ->assertSame (51 , $ fieldDesc ->getNumber ());
190- $ this ->assertSame (self ::GPBLABEL_OPTIONAL , $ fieldDesc ->getLabel ());
193+ $ this ->assertFalse ($ fieldDesc ->isRequired ());
194+ $ this ->assertFalse ($ fieldDesc ->isRepeated ());
191195 $ this ->assertSame (self ::GPBTYPE_INT32 , $ fieldDesc ->getType ());
192196 $ this ->assertFalse ($ fieldDesc ->isMap ());
193197 $ this ->assertSame ($ fieldDesc ->getContainingOneof (), $ fieldDesc ->getRealContainingOneof ());
@@ -200,7 +204,8 @@ public function testFieldDescriptor()
200204 $ fieldDesc = $ fieldDescMap [52 ];
201205 $ this ->assertSame ('proto3_optional_int32 ' , $ fieldDesc ->getName ());
202206 $ this ->assertSame (52 , $ fieldDesc ->getNumber ());
203- $ this ->assertSame (self ::GPBLABEL_OPTIONAL , $ fieldDesc ->getLabel ());
207+ $ this ->assertFalse ($ fieldDesc ->isRequired ());
208+ $ this ->assertFalse ($ fieldDesc ->isRepeated ());
204209 $ this ->assertSame (self ::GPBTYPE_INT32 , $ fieldDesc ->getType ());
205210 $ this ->assertFalse ($ fieldDesc ->isMap ());
206211 $ this ->assertNull ($ fieldDesc ->getRealContainingOneof ());
@@ -210,7 +215,7 @@ public function testFieldDescriptor()
210215 $ fieldDesc = $ fieldDescMap [71 ];
211216 $ this ->assertSame ('map_int32_enum ' , $ fieldDesc ->getName ());
212217 $ this ->assertSame (71 , $ fieldDesc ->getNumber ());
213- $ this ->assertSame ( self :: GPBLABEL_REPEATED , $ fieldDesc ->getLabel ());
218+ $ this ->assertTrue ( $ fieldDesc ->isRepeated ());
214219 $ this ->assertSame (self ::GPBTYPE_MESSAGE , $ fieldDesc ->getType ());
215220 $ this ->assertTrue ($ fieldDesc ->isMap ());
216221 $ mapDesc = $ fieldDesc ->getMessageType ();
0 commit comments