Skip to content

Commit

Permalink
getObjectStatus -> retrieveObjectStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Feb 7, 2018
1 parent 4b9db45 commit e3b4216
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/Events/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 4 additions & 4 deletions tests/Events/BookObjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);
}
Expand All @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Events/ChangeBestAvailableObjectStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand All @@ -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);
}
Expand Down
16 changes: 8 additions & 8 deletions tests/Events/ChangeObjectStatusForMultipleEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down
24 changes: 12 additions & 12 deletions tests/Events/ChangeObjectStatusForMultipleObjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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);
}
Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Events/ChangeObjectStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Events/HoldObjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Events/ReleaseObjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

use Seatsio\SeatsioClientTest;

class GetObjectStatusTest extends SeatsioClientTest
class RetrieveObjectStatusTest extends SeatsioClientTest
{

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);
Expand Down
2 changes: 1 addition & 1 deletion tests/Events/UpdateExtraDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e3b4216

Please sign in to comment.