From 3069f67f0856d34f63aaae4c80579a54f04141b9 Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Wed, 16 Mar 2022 10:37:30 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Use=20POST=20/track=20instead=20of?= =?UTF-8?q?=20POST=20/events?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://developers.journy.io/#section/Backend/Changelog --- src/Client.php | 2 +- tests/ClientTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index e25dbed..a3c4104 100644 --- a/src/Client.php +++ b/src/Client.php @@ -303,7 +303,7 @@ public function addEvent(Event $event): CallResult $this->requestFactory ->createRequest( "POST", - new Uri("{$this->rootUrl}/events") + new Uri("{$this->rootUrl}/track") ) ->withHeader("content-type", "application/json") ->withBody($body) diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 0a7efd8..d3002ef 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -666,6 +666,8 @@ public function test_it_triggers_event_for_user() $request = $http->getLastRequest(); $this->assertInstanceOf(RequestInterface::class, $request); if ($request instanceof RequestInterface) { + $this->assertEquals("POST", $request->getMethod()); + $this->assertEquals("/track", $request->getUri()->getPath()); $request->getBody()->rewind(); $body = $request->getBody()->getContents(); $payload = json_decode($body, true);