diff --git a/src/Events/Events.php b/src/Events/Events.php index 4541f85..790bf11 100644 --- a/src/Events/Events.php +++ b/src/Events/Events.php @@ -167,7 +167,7 @@ public function updateExtraData($eventKey, $object, $extraData) * @param $object string * @return ObjectStatus */ - public function getObjectStatus($eventKey, $object) + public function retrieveObjectStatus($eventKey, $object) { $res = $this->client->get(\GuzzleHttp\uri_template('/events/{key}/objects/{object}', ["key" => $eventKey, "object" => $object])); $json = \GuzzleHttp\json_decode($res->getBody()); diff --git a/tests/Events/BookObjectsTest.php b/tests/Events/BookObjectsTest.php index 64dffd5..fe9322a 100644 --- a/tests/Events/BookObjectsTest.php +++ b/tests/Events/BookObjectsTest.php @@ -14,8 +14,8 @@ public function test() $this->seatsioClient->events()->book($event->key, ["A-1", "A-2"]); - self::assertEquals(ObjectStatus::$BOOKED, $this->seatsioClient->events()->getObjectStatus($event->key, "A-1")->status); - self::assertEquals(ObjectStatus::$BOOKED, $this->seatsioClient->events()->getObjectStatus($event->key, "A-2")->status); + self::assertEquals(ObjectStatus::$BOOKED, $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1")->status); + self::assertEquals(ObjectStatus::$BOOKED, $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2")->status); } public function testHoldToken() @@ -27,7 +27,7 @@ public function testHoldToken() $this->seatsioClient->events()->book($event->key, "A-1", $holdToken->holdToken); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals(ObjectStatus::$BOOKED, $objectStatus->status); self::assertNull($objectStatus->holdToken); } @@ -39,7 +39,7 @@ public function testOrderId() $this->seatsioClient->events()->book($event->key, "A-1", null, "order1"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("order1", $objectStatus->orderId); } diff --git a/tests/Events/ChangeBestAvailableObjectStatusTest.php b/tests/Events/ChangeBestAvailableObjectStatusTest.php index 068a583..e75b7b0 100644 --- a/tests/Events/ChangeBestAvailableObjectStatusTest.php +++ b/tests/Events/ChangeBestAvailableObjectStatusTest.php @@ -36,7 +36,7 @@ public function testHoldToken() $bestAvailableObjects = $this->seatsioClient->events()->changeBestAvailableObjectStatus($event->key, 1, ObjectStatus::$HELD, null, $holdToken->holdToken); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, $bestAvailableObjects->objects[0]); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, $bestAvailableObjects->objects[0]); self::assertEquals(ObjectStatus::$HELD, $objectStatus->status); self::assertEquals($holdToken->holdToken, $objectStatus->holdToken); } @@ -48,7 +48,7 @@ public function testOrderId() $bestAvailableObjects = $this->seatsioClient->events()->changeBestAvailableObjectStatus($event->key, 1, "lolzor", null, null, "anOrder"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, $bestAvailableObjects->objects[0]); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, $bestAvailableObjects->objects[0]); self::assertEquals("anOrder", $objectStatus->orderId); } @@ -71,7 +71,7 @@ public function hold() $bestAvailableObjects = $this->seatsioClient->events()->holdBestAvailable($event->key, 1, $holdToken->holdToken); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, $bestAvailableObjects->objects[0]); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, $bestAvailableObjects->objects[0]); self::assertEquals(ObjectStatus::$HELD, $objectStatus->status); self::assertEquals($holdToken->holdToken, $objectStatus->holdToken); } diff --git a/tests/Events/ChangeObjectStatusForMultipleEventsTest.php b/tests/Events/ChangeObjectStatusForMultipleEventsTest.php index ccd23b3..ac1abec 100644 --- a/tests/Events/ChangeObjectStatusForMultipleEventsTest.php +++ b/tests/Events/ChangeObjectStatusForMultipleEventsTest.php @@ -15,10 +15,10 @@ public function test() $this->seatsioClient->events()->changeObjectStatus([$event1->key, $event2->key], "A-1", "lolzor"); - $objectStatus1 = $this->seatsioClient->events()->getObjectStatus($event1->key, "A-1"); + $objectStatus1 = $this->seatsioClient->events()->retrieveObjectStatus($event1->key, "A-1"); self::assertEquals("lolzor", $objectStatus1->status); - $objectStatus2 = $this->seatsioClient->events()->getObjectStatus($event2->key, "A-1"); + $objectStatus2 = $this->seatsioClient->events()->retrieveObjectStatus($event2->key, "A-1"); self::assertEquals("lolzor", $objectStatus2->status); } @@ -30,10 +30,10 @@ public function testBook() $this->seatsioClient->events()->book([$event1->key, $event2->key], "A-1"); - $objectStatus1 = $this->seatsioClient->events()->getObjectStatus($event1->key, "A-1"); + $objectStatus1 = $this->seatsioClient->events()->retrieveObjectStatus($event1->key, "A-1"); self::assertEquals(ObjectStatus::$BOOKED, $objectStatus1->status); - $objectStatus2 = $this->seatsioClient->events()->getObjectStatus($event2->key, "A-1"); + $objectStatus2 = $this->seatsioClient->events()->retrieveObjectStatus($event2->key, "A-1"); self::assertEquals(ObjectStatus::$BOOKED, $objectStatus2->status); } @@ -46,10 +46,10 @@ public function testRelease() $this->seatsioClient->events()->release([$event1->key, $event2->key], "A-1"); - $objectStatus1 = $this->seatsioClient->events()->getObjectStatus($event1->key, "A-1"); + $objectStatus1 = $this->seatsioClient->events()->retrieveObjectStatus($event1->key, "A-1"); self::assertEquals(ObjectStatus::$FREE, $objectStatus1->status); - $objectStatus2 = $this->seatsioClient->events()->getObjectStatus($event2->key, "A-1"); + $objectStatus2 = $this->seatsioClient->events()->retrieveObjectStatus($event2->key, "A-1"); self::assertEquals(ObjectStatus::$FREE, $objectStatus2->status); } @@ -62,10 +62,10 @@ public function testHold() $this->seatsioClient->events()->hold([$event1->key, $event2->key], "A-1", $holdToken->holdToken); - $objectStatus1 = $this->seatsioClient->events()->getObjectStatus($event1->key, "A-1"); + $objectStatus1 = $this->seatsioClient->events()->retrieveObjectStatus($event1->key, "A-1"); self::assertEquals(ObjectStatus::$HELD, $objectStatus1->status); - $objectStatus2 = $this->seatsioClient->events()->getObjectStatus($event2->key, "A-1"); + $objectStatus2 = $this->seatsioClient->events()->retrieveObjectStatus($event2->key, "A-1"); self::assertEquals(ObjectStatus::$HELD, $objectStatus2->status); } diff --git a/tests/Events/ChangeObjectStatusForMultipleObjectsTest.php b/tests/Events/ChangeObjectStatusForMultipleObjectsTest.php index 2afb2cd..2a6f2d9 100644 --- a/tests/Events/ChangeObjectStatusForMultipleObjectsTest.php +++ b/tests/Events/ChangeObjectStatusForMultipleObjectsTest.php @@ -14,8 +14,8 @@ public function testArrayOfStrings() $this->seatsioClient->events()->changeObjectStatus($event->key, ["A-1", "A-2"], "lolzor"); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-1")->status); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-2")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2")->status); } public function testArrayOfObjects() @@ -26,8 +26,8 @@ public function testArrayOfObjects() $this->seatsioClient->events()->changeObjectStatus($event->key, $objects, "lolzor"); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-1")->status); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-2")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2")->status); } public function testArrayOfAssociativeArrays() @@ -38,8 +38,8 @@ public function testArrayOfAssociativeArrays() $this->seatsioClient->events()->changeObjectStatus($event->key, $objects, "lolzor"); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-1")->status); - self::assertEquals("lolzor", $this->seatsioClient->events()->getObjectStatus($event->key, "A-2")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1")->status); + self::assertEquals("lolzor", $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2")->status); } public function testTicketType() @@ -53,11 +53,11 @@ public function testTicketType() $this->seatsioClient->events()->changeObjectStatus($event->key, $objects, "lolzor"); - $status1 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $status1 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("lolzor", $status1->status); self::assertEquals("T1", $status1->ticketType); - $status2 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-2"); + $status2 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2"); self::assertEquals("lolzor", $status2->status); self::assertEquals("T2", $status2->ticketType); } @@ -73,10 +73,10 @@ public function testQuantity() $this->seatsioClient->events()->changeObjectStatus($event->key, $objects, "lolzor"); - $status1 = $this->seatsioClient->events()->getObjectStatus($event->key, "GA1"); + $status1 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "GA1"); self::assertEquals(5, $status1->quantity); - $status2 = $this->seatsioClient->events()->getObjectStatus($event->key, "GA2"); + $status2 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "GA2"); self::assertEquals(10, $status2->quantity); } @@ -91,10 +91,10 @@ public function testExtraData() $this->seatsioClient->events()->changeObjectStatus($event->key, $objects, "lolzor"); - $status1 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $status1 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals((object)(["foo" => "bar"]), $status1->extraData); - $status2 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-2"); + $status2 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2"); self::assertEquals((object)(["foo" => "baz"]), $status2->extraData); } diff --git a/tests/Events/ChangeObjectStatusTest.php b/tests/Events/ChangeObjectStatusTest.php index eefeb31..f09b949 100644 --- a/tests/Events/ChangeObjectStatusTest.php +++ b/tests/Events/ChangeObjectStatusTest.php @@ -14,7 +14,7 @@ public function testObjectIdAsString() $this->seatsioClient->events()->changeObjectStatus($event->key, "A-1", "lolzor"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("lolzor", $objectStatus->status); } @@ -25,7 +25,7 @@ public function testObjectIdInsideObject() $this->seatsioClient->events()->changeObjectStatus($event->key, new ObjectProperties("A-1"), "lolzor"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("lolzor", $objectStatus->status); } @@ -37,7 +37,7 @@ public function testHoldToken() $this->seatsioClient->events()->changeObjectStatus($event->key, "A-1", ObjectStatus::$HELD, $holdToken->holdToken); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals(ObjectStatus::$HELD, $objectStatus->status); self::assertEquals($holdToken->holdToken, $objectStatus->holdToken); } @@ -49,7 +49,7 @@ public function testOrderId() $this->seatsioClient->events()->changeObjectStatus($event->key, "A-1", "lolzor", null, "order1"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("order1", $objectStatus->orderId); } diff --git a/tests/Events/HoldObjectsTest.php b/tests/Events/HoldObjectsTest.php index f53db87..3a36a06 100644 --- a/tests/Events/HoldObjectsTest.php +++ b/tests/Events/HoldObjectsTest.php @@ -15,11 +15,11 @@ public function test() $this->seatsioClient->events()->hold($event->key, ["A-1", "A-2"], $holdToken->holdToken); - $status1 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $status1 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals(ObjectStatus::$HELD, $status1->status); self::assertEquals($holdToken->holdToken, $status1->holdToken); - $status2 = $this->seatsioClient->events()->getObjectStatus($event->key, "A-2"); + $status2 = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2"); self::assertEquals(ObjectStatus::$HELD, $status2->status); self::assertEquals($holdToken->holdToken, $status2->holdToken); } @@ -32,7 +32,7 @@ public function testOrderId() $this->seatsioClient->events()->hold($event->key, "A-1", $holdToken->holdToken, "order1"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("order1", $objectStatus->orderId); } diff --git a/tests/Events/ReleaseObjectsTest.php b/tests/Events/ReleaseObjectsTest.php index fbb1488..0f323ac 100644 --- a/tests/Events/ReleaseObjectsTest.php +++ b/tests/Events/ReleaseObjectsTest.php @@ -15,8 +15,8 @@ public function test() $this->seatsioClient->events()->release($event->key, ["A-1", "A-2"]); - self::assertEquals(ObjectStatus::$FREE, $this->seatsioClient->events()->getObjectStatus($event->key, "A-1")->status); - self::assertEquals(ObjectStatus::$FREE, $this->seatsioClient->events()->getObjectStatus($event->key, "A-2")->status); + self::assertEquals(ObjectStatus::$FREE, $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1")->status); + self::assertEquals(ObjectStatus::$FREE, $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-2")->status); } public function testHoldToken() @@ -28,7 +28,7 @@ public function testHoldToken() $this->seatsioClient->events()->release($event->key, "A-1", $holdToken->holdToken); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertNull($objectStatus->holdToken); } @@ -40,7 +40,7 @@ public function testOrderId() $this->seatsioClient->events()->release($event->key, "A-1", null, "order1"); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals("order1", $objectStatus->orderId); } diff --git a/tests/Events/GetObjectStatusTest.php b/tests/Events/RetrieveObjectStatusTest.php similarity index 72% rename from tests/Events/GetObjectStatusTest.php rename to tests/Events/RetrieveObjectStatusTest.php index 0796285..222ab5d 100644 --- a/tests/Events/GetObjectStatusTest.php +++ b/tests/Events/RetrieveObjectStatusTest.php @@ -4,7 +4,7 @@ use Seatsio\SeatsioClientTest; -class GetObjectStatusTest extends SeatsioClientTest +class RetrieveObjectStatusTest extends SeatsioClientTest { public function test() @@ -12,7 +12,7 @@ public function test() $chartKey = $this->createTestChart(); $event = $this->seatsioClient->events()->create($chartKey); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals(ObjectStatus::$FREE, $objectStatus->status); self::assertNull($objectStatus->ticketType); self::assertNull($objectStatus->extraData); diff --git a/tests/Events/UpdateExtraDataTest.php b/tests/Events/UpdateExtraDataTest.php index 189c4d9..4afbc5f 100644 --- a/tests/Events/UpdateExtraDataTest.php +++ b/tests/Events/UpdateExtraDataTest.php @@ -15,7 +15,7 @@ public function test() $this->seatsioClient->events()->updateExtraData($event->key, "A-1", $extraData); - $objectStatus = $this->seatsioClient->events()->getObjectStatus($event->key, "A-1"); + $objectStatus = $this->seatsioClient->events()->retrieveObjectStatus($event->key, "A-1"); self::assertEquals((object)$extraData, $objectStatus->extraData); }