A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/protocolbuffers/protobuf/commit/d82de8f147be07e7a10c5c395505f0a662a911f2 below:

Deprecate Descriptor Label. As an alternative, add helper methods for… · protocolbuffers/protobuf@d82de8f · GitHub

@@ -142,15 +142,17 @@ public function testFieldDescriptor()

142 142

$fieldDesc = $fieldDescMap[1];

143 143

$this->assertSame('optional_int32', $fieldDesc->getName());

144 144

$this->assertSame(1, $fieldDesc->getNumber());

145 -

$this->assertSame(self::GPBLABEL_OPTIONAL, $fieldDesc->getLabel());

145 +

$this->assertFalse($fieldDesc->isRequired());

146 +

$this->assertFalse($fieldDesc->isRepeated());

146 147

$this->assertSame(self::GPBTYPE_INT32, $fieldDesc->getType());

147 148

$this->assertFalse($fieldDesc->isMap());

148 149 149 150

// Optional enum field

150 151

$fieldDesc = $fieldDescMap[16];

151 152

$this->assertSame('optional_enum', $fieldDesc->getName());

152 153

$this->assertSame(16, $fieldDesc->getNumber());

153 -

$this->assertSame(self::GPBLABEL_OPTIONAL, $fieldDesc->getLabel());

154 +

$this->assertFalse($fieldDesc->isRequired());

155 +

$this->assertFalse($fieldDesc->isRepeated());

154 156

$this->assertSame(self::GPBTYPE_ENUM, $fieldDesc->getType());

155 157

$this->assertInstanceOf('\Google\Protobuf\EnumDescriptor', $fieldDesc->getEnumType());

156 158

$this->assertFalse($fieldDesc->isMap());

@@ -159,7 +161,8 @@ public function testFieldDescriptor()

159 161

$fieldDesc = $fieldDescMap[17];

160 162

$this->assertSame('optional_message', $fieldDesc->getName());

161 163

$this->assertSame(17, $fieldDesc->getNumber());

162 -

$this->assertSame(self::GPBLABEL_OPTIONAL, $fieldDesc->getLabel());

164 +

$this->assertFalse($fieldDesc->isRequired());

165 +

$this->assertFalse($fieldDesc->isRepeated());

163 166

$this->assertSame(self::GPBTYPE_MESSAGE, $fieldDesc->getType());

164 167

$this->assertInstanceOf('\Google\Protobuf\Descriptor', $fieldDesc->getMessageType());

165 168

$this->assertFalse($fieldDesc->isMap());

@@ -168,15 +171,15 @@ public function testFieldDescriptor()

168 171

$fieldDesc = $fieldDescMap[31];

169 172

$this->assertSame('repeated_int32', $fieldDesc->getName());

170 173

$this->assertSame(31, $fieldDesc->getNumber());

171 -

$this->assertSame(self::GPBLABEL_REPEATED, $fieldDesc->getLabel());

174 +

$this->assertTrue($fieldDesc->isRepeated());

172 175

$this->assertSame(self::GPBTYPE_INT32, $fieldDesc->getType());

173 176

$this->assertFalse($fieldDesc->isMap());

174 177 175 178

// Repeated message field

176 179

$fieldDesc = $fieldDescMap[47];

177 180

$this->assertSame('repeated_message', $fieldDesc->getName());

178 181

$this->assertSame(47, $fieldDesc->getNumber());

179 -

$this->assertSame(self::GPBLABEL_REPEATED, $fieldDesc->getLabel());

182 +

$this->assertTrue($fieldDesc->isRepeated());

180 183

$this->assertSame(self::GPBTYPE_MESSAGE, $fieldDesc->getType());

181 184

$this->assertInstanceOf('\Google\Protobuf\Descriptor', $fieldDesc->getMessageType());

182 185

$this->assertFalse($fieldDesc->isMap());

@@ -187,7 +190,8 @@ public function testFieldDescriptor()

187 190

$fieldDesc = $fieldDescMap[51];

188 191

$this->assertSame('oneof_int32', $fieldDesc->getName());

189 192

$this->assertSame(51, $fieldDesc->getNumber());

190 -

$this->assertSame(self::GPBLABEL_OPTIONAL, $fieldDesc->getLabel());

193 +

$this->assertFalse($fieldDesc->isRequired());

194 +

$this->assertFalse($fieldDesc->isRepeated());

191 195

$this->assertSame(self::GPBTYPE_INT32, $fieldDesc->getType());

192 196

$this->assertFalse($fieldDesc->isMap());

193 197

$this->assertSame($fieldDesc->getContainingOneof(), $fieldDesc->getRealContainingOneof());

@@ -200,7 +204,8 @@ public function testFieldDescriptor()

200 204

$fieldDesc = $fieldDescMap[52];

201 205

$this->assertSame('proto3_optional_int32', $fieldDesc->getName());

202 206

$this->assertSame(52, $fieldDesc->getNumber());

203 -

$this->assertSame(self::GPBLABEL_OPTIONAL, $fieldDesc->getLabel());

207 +

$this->assertFalse($fieldDesc->isRequired());

208 +

$this->assertFalse($fieldDesc->isRepeated());

204 209

$this->assertSame(self::GPBTYPE_INT32, $fieldDesc->getType());

205 210

$this->assertFalse($fieldDesc->isMap());

206 211

$this->assertNull($fieldDesc->getRealContainingOneof());

@@ -210,7 +215,7 @@ public function testFieldDescriptor()

210 215

$fieldDesc = $fieldDescMap[71];

211 216

$this->assertSame('map_int32_enum', $fieldDesc->getName());

212 217

$this->assertSame(71, $fieldDesc->getNumber());

213 -

$this->assertSame(self::GPBLABEL_REPEATED, $fieldDesc->getLabel());

218 +

$this->assertTrue($fieldDesc->isRepeated());

214 219

$this->assertSame(self::GPBTYPE_MESSAGE, $fieldDesc->getType());

215 220

$this->assertTrue($fieldDesc->isMap());

216 221

$mapDesc = $fieldDesc->getMessageType();


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4