aboutsummaryrefslogtreecommitdiff
path: root/php/tests
diff options
context:
space:
mode:
authorBrent Shaffer <betterbrent@google.com>2017-05-29 10:39:14 -0700
committerPaul Yang <TeBoring@users.noreply.github.com>2017-05-29 10:39:14 -0700
commit4d5daf4ef97918176b892dbedce17b1d854ffe8e (patch)
tree878663f363714f9f7b1e7ab3f2ea74d1d0a1321c /php/tests
parent4674cc7c073f1b8d5efd2a42ffcf3ca30a907bfe (diff)
downloadprotobuf-4d5daf4ef97918176b892dbedce17b1d854ffe8e.tar.gz
protobuf-4d5daf4ef97918176b892dbedce17b1d854ffe8e.tar.bz2
protobuf-4d5daf4ef97918176b892dbedce17b1d854ffe8e.zip
Adds fluent setters for PHP (#3130)
Diffstat (limited to 'php/tests')
-rw-r--r--php/tests/generated_class_test.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php
index 21ee8490..b42397bb 100644
--- a/php/tests/generated_class_test.php
+++ b/php/tests/generated_class_test.php
@@ -877,4 +877,17 @@ class GeneratedClassTest extends TestBase
$m = new \Foo\PBEmpty();
$m = new \PrefixEmpty();
}
+
+ #########################################################
+ # Test fluent setters.
+ #########################################################
+
+ public function testFluentSetters()
+ {
+ $m = (new TestMessage())
+ ->setOptionalInt32(1)
+ ->setOptionalInt64(2);
+ $this->assertSame(1, $m->getOptionalInt32());
+ $this->assertSame(2, $m->getOptionalInt64());
+ }
}