Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: third_party/protobuf/php/tests/encode_decode_test.php

Issue 2590803003: Revert "third_party/protobuf: Update to HEAD (83d681ee2c)" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/php/tests/autoload.php ('k') | third_party/protobuf/php/tests/gdb_test.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/php/tests/encode_decode_test.php
diff --git a/third_party/protobuf/php/tests/encode_decode_test.php b/third_party/protobuf/php/tests/encode_decode_test.php
deleted file mode 100644
index af9c04154d83e98a3e191ea512acdb4cf9b14947..0000000000000000000000000000000000000000
--- a/third_party/protobuf/php/tests/encode_decode_test.php
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-
-require_once('test_base.php');
-require_once('test_util.php');
-
-use Google\Protobuf\RepeatedField;
-use Google\Protobuf\GPBType;
-use Foo\TestEnum;
-use Foo\TestMessage;
-use Foo\TestMessage_Sub;
-use Foo\TestPackedMessage;
-use Foo\TestUnpackedMessage;
-
-class EncodeDecodeTest extends TestBase
-{
-
- public function testEncode()
- {
- $from = new TestMessage();
- $this->expectEmptyFields($from);
- $this->setFields($from);
- $this->expectFields($from);
-
- $data = $from->encode();
- $this->assertSame(TestUtil::getGoldenTestMessage(), $data);
- }
-
- public function testDecode()
- {
- $to = new TestMessage();
- $to->decode(TestUtil::getGoldenTestMessage());
- $this->expectFields($to);
- }
-
- public function testEncodeDecode()
- {
- $from = new TestMessage();
- $this->expectEmptyFields($from);
- $this->setFields($from);
- $this->expectFields($from);
-
- $data = $from->encode();
-
- $to = new TestMessage();
- $to->decode($data);
- $this->expectFields($to);
- }
-
- public function testEncodeDecodeEmpty()
- {
- $from = new TestMessage();
- $this->expectEmptyFields($from);
-
- $data = $from->encode();
-
- $to = new TestMessage();
- $to->decode($data);
- $this->expectEmptyFields($to);
- }
-
- public function testEncodeDecodeOneof()
- {
- $m = new TestMessage();
-
- $m->setOneofInt32(1);
- $data = $m->encode();
- $n = new TestMessage();
- $n->decode($data);
- $this->assertSame(1, $n->getOneofInt32());
-
- $m->setOneofFloat(2.0);
- $data = $m->encode();
- $n = new TestMessage();
- $n->decode($data);
- $this->assertSame(2.0, $n->getOneofFloat());
-
- $m->setOneofString('abc');
- $data = $m->encode();
- $n = new TestMessage();
- $n->decode($data);
- $this->assertSame('abc', $n->getOneofString());
-
- $sub_m = new TestMessage_Sub();
- $sub_m->setA(1);
- $m->setOneofMessage($sub_m);
- $data = $m->encode();
- $n = new TestMessage();
- $n->decode($data);
- $this->assertSame(1, $n->getOneofMessage()->getA());
- }
-
- public function testPackedEncode()
- {
- $from = new TestPackedMessage();
- TestUtil::setTestPackedMessage($from);
- $this->assertSame(TestUtil::getGoldenTestPackedMessage(),
- $from->encode());
- }
-
- public function testPackedDecodePacked()
- {
- $to = new TestPackedMessage();
- $to->decode(TestUtil::getGoldenTestPackedMessage());
- TestUtil::assertTestPackedMessage($to);
- }
-
- public function testPackedDecodeUnpacked()
- {
- $to = new TestPackedMessage();
- $to->decode(TestUtil::getGoldenTestUnpackedMessage());
- TestUtil::assertTestPackedMessage($to);
- }
-
- public function testUnpackedEncode()
- {
- $from = new TestUnpackedMessage();
- TestUtil::setTestPackedMessage($from);
- $this->assertSame(TestUtil::getGoldenTestUnpackedMessage(),
- $from->encode());
- }
-
- public function testUnpackedDecodePacked()
- {
- $to = new TestUnpackedMessage();
- $to->decode(TestUtil::getGoldenTestPackedMessage());
- TestUtil::assertTestPackedMessage($to);
- }
-
- public function testUnpackedDecodeUnpacked()
- {
- $to = new TestUnpackedMessage();
- $to->decode(TestUtil::getGoldenTestUnpackedMessage());
- TestUtil::assertTestPackedMessage($to);
- }
-}
« no previous file with comments | « third_party/protobuf/php/tests/autoload.php ('k') | third_party/protobuf/php/tests/gdb_test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698