From 446749be60c1fccff86a3b6291ad8367ef579466 Mon Sep 17 00:00:00 2001 From: darthmaim Date: Sun, 22 Jan 2017 01:20:24 +0100 Subject: [PATCH] add /v2/wvw/ranks --- src/V2/Endpoint/WvW/RankEndpoint.php | 20 ++++++++++++++++++++ src/V2/Endpoint/WvW/WvWEndpoint.php | 4 ++++ tests/V2/WvWEndpointTest.php | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/V2/Endpoint/WvW/RankEndpoint.php diff --git a/src/V2/Endpoint/WvW/RankEndpoint.php b/src/V2/Endpoint/WvW/RankEndpoint.php new file mode 100644 index 0000000..86a6785 --- /dev/null +++ b/src/V2/Endpoint/WvW/RankEndpoint.php @@ -0,0 +1,20 @@ +api ); } + + public function ranks() { + return new RankEndpoint( $this->api ); + } } diff --git a/tests/V2/WvWEndpointTest.php b/tests/V2/WvWEndpointTest.php index 1f2dc51..9c834a1 100644 --- a/tests/V2/WvWEndpointTest.php +++ b/tests/V2/WvWEndpointTest.php @@ -38,4 +38,15 @@ public function testMatchEndpoint() { $this->mockResponse('{"id":"2-6","scores":{"red":169331,"blue":246780,"green":216241}}'); $this->assertEquals(169331, $endpoint->world('id')->scores->red); } + + public function testRankEndpoint() { + $endpoint = $this->api()->wvw()->ranks(); + + $this->assertEndpointUrl('v2/wvw/ranks', $endpoint); + $this->assertEndpointIsBulk($endpoint); + $this->assertEndpointIsLocalized($endpoint); + + $this->mockResponse('{"id":1,"title":"Invader","min_rank":1}'); + $this->assertEquals('Invader', $endpoint->get(1)->title); + } }