THRIFT-5587: Add UUID support for PHP
Client: py
Patch: Volodymyr Panivko
This closes #3332
diff --git a/test/php/Handler.php b/test/php/Handler.php
index 5ca06a2..3ea1f58 100644
--- a/test/php/Handler.php
+++ b/test/php/Handler.php
@@ -42,6 +42,11 @@
return $thing;
}
+ public function testUuid($thing)
+ {
+ return $thing;
+ }
+
public function testStruct(\ThriftTest\Xtruct $thing)
{
return $thing;
diff --git a/test/php/Makefile.am b/test/php/Makefile.am
index 1cffdd4..60a63cf 100644
--- a/test/php/Makefile.am
+++ b/test/php/Makefile.am
@@ -17,11 +17,11 @@
# under the License.
#
-stubs: ../v0.16/ThriftTest.thrift
- $(THRIFT) --gen php ../v0.16/ThriftTest.thrift
- $(THRIFT) --gen php:inlined ../v0.16/ThriftTest.thrift
+stubs: ../ThriftTest.thrift
+ $(THRIFT) --gen php ../ThriftTest.thrift
+ $(THRIFT) --gen php:inlined ../ThriftTest.thrift
$(MKDIR_P) gen-php-classmap
- $(THRIFT) -out gen-php-classmap --gen php:classmap ../v0.16/ThriftTest.thrift
+ $(THRIFT) -out gen-php-classmap --gen php:classmap ../ThriftTest.thrift
php_ext_dir:
mkdir -p php_ext_dir
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index acd901d..fba0178 100755
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -189,6 +189,21 @@
*/
/**
+ * UUID TEST
+ */
+print_r("testUuid('00000000-0000-0000-0000-000000000000')");
+$uuid_in = '00000000-0000-0000-0000-000000000000';
+$uuid_out = $testClient->testUuid($uuid_in);
+print_r(" = \"$uuid_out\"\n");
+if ($uuid_in !== $uuid_out) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_BASETYPES;
+}
+
+roundtrip($testClient, 'testUuid', '00000000-0000-0000-0000-000000000000');
+roundtrip($testClient, 'testUuid', '550e8400-e29b-41d4-a716-446655440000');
+
+/**
* STRUCT TEST
*/
print_r("testStruct({\"Zero\", 1, -3, -5})");