示例#1
0
 public function testFormatRepeatedInt()
 {
     $repeated = new Repeated();
     $repeated->addInt(1);
     $repeated->addInt(2);
     $repeated->addInt(3);
     $expected = $this->getProtoContent('repeated-int32.txt');
     $actual = $this->textFormat->encodeMessage($repeated);
     $this->assertEquals($expected, (string) $actual);
 }
 public function testWriteRepeatedInt32()
 {
     $repeated = new Repeated();
     $repeated->addInt(1);
     $repeated->addInt(2);
     $repeated->addInt(3);
     $expected = $this->getProtoContent('repeated-int32.bin');
     $actual = $repeated->toStream();
     $this->assertEquals($expected, (string) $actual);
     $this->assertSerializedMessageSize($expected, $repeated);
 }