function testUnregisterDefaultCodec() { $result = Protobuf::unregisterCodec('default'); $this->assertTrue($result); // Ensure a new default is given $getted = Protobuf::getCodec(); $this->assertInstanceOf('DrSlump\\Protobuf\\Codec\\Binary', $getted); }
/** * Serialize the current object data * * @param CodecInterface|null $codec * @return string */ public function serialize(Protobuf\CodecInterface $codec = null) { $codec = Protobuf::getCodec($codec); return $codec->encode($this); }