diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ea6ecc --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +composer.phar +.idea/ +vendor/ + + diff --git a/src/Model/Message/AppMessage.php b/src/Model/Message/AppMessage.php index 055e8ab..b227499 100644 --- a/src/Model/Message/AppMessage.php +++ b/src/Model/Message/AppMessage.php @@ -167,7 +167,7 @@ public function jsonSerialize() if ($this->traceId != null) $data["trace_id"] = $this->traceId; if ($this->appId != null) $data["app_id"] = $this->appId; if ($this->header != null) $data["header"] = $this->header; - if ($this->userUniqueId != null) $data["user_unique_id"] = $this->userUniqueId; + if ($this->userUniqueId !== null) $data["user_unique_id"] = $this->userUniqueId; if ($this->eventV3 != null) $data["event_v3"] = $this->eventV3; return $data; } diff --git a/test/HttpTester.php b/test/HttpTester.php index 0605e9c..3633e47 100644 --- a/test/HttpTester.php +++ b/test/HttpTester.php @@ -47,6 +47,11 @@ $header->setUserUniqueId("test-uuid2"); $header->setClientIp("49.7.44.244"); $header->setOs("android"); +$header->setDeviceId(7786627007290925058); + +$rc->sendUserDefineEvent($header, "", 10000000, null, "php_event_with_anonymous", + ["php_name" => "php", "php_version" => "5.6", "float_param" => floatval(5), "session_id" => "1234567890"]); + $rc->sendUserDefineEvent($header, "test-uuid2", 10000000, null, "php_event_with_items", ["php_name" => "php", "php_version" => "5.6", "float_param" => floatval(5), "session_id" => "1234567890"], $items); @@ -71,3 +76,5 @@ [["php_name" => "php", "php_version" => "5.6"]], [ [["item_name" => "book", "item_id" => "0001"], ["item_name" => "book", "item_id" => "0002"]] ]); + +sleep(10);