/** * Serialized \Skrz\Meta\Fixtures\Protobuf\ClassWithFixed64Property to Protocol Buffers message. * * @param ClassWithFixed64Property $object * @param array $filter * * @throws \Exception * * @return string */ public static function toProtobuf($object, $filter = NULL) { $output = ''; if (isset($object->x) && ($filter === null || isset($filter['x']))) { $output .= "\t"; $output .= Binary::encodeUint64($object->x); } return $output; }
public function testClassWithFixed64PropertyToProtobuf() { $this->assertEquals(chr(1 << 3 | WireTypeEnum::toBinaryWireType(WireTypeEnum::FIXED64)) . Binary::encodeUint64(45423), ClassWithFixed64PropertyMeta::toProtobuf((new ClassWithFixed64Property())->setX(45423))); }