Skip to content

Commit

Permalink
add additional tests to check query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Jan 22, 2017
1 parent ac7d1b9 commit 10aac58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/V2/RecipeEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testSearchInput() {

$this->mockResponse( '[7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275]' );
$this->assertContains( 7267, $endpoint->input(43775) );
$this->assertEquals('input=43775', $this->getLastRequest()->getUri()->getQuery());
}

public function testSearchOutput() {
Expand All @@ -27,5 +28,6 @@ public function testSearchOutput() {

$this->mockResponse( '[7237]' );
$this->assertEquals( [7237], $endpoint->output(43775) );
$this->assertEquals('output=43775', $this->getLastRequest()->getUri()->getQuery());
}
}
4 changes: 4 additions & 0 deletions tests/V2/WvWEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function testMatchEndpoint() {

$this->mockResponse('{"id":"2-6","scores":{"red":169331,"blue":246780,"green":216241}}');
$this->assertEquals(169331, $endpoint->world('id')->scores->red);
$this->assertEquals('world=id', $this->getLastRequest()->getUri()->getQuery());
}

public function testMatchOverviewEndpoint() {
Expand All @@ -47,6 +48,7 @@ public function testMatchOverviewEndpoint() {

$this->mockResponse('{"id":"1-1","worlds":{"red":1008,"blue":1019,"green":1005}}');
$this->assertEquals(1008, $endpoint->world(1008)->worlds->red);
$this->assertEquals('world=1008', $this->getLastRequest()->getUri()->getQuery());
}

public function testMatchScoreEndpoint() {
Expand All @@ -57,6 +59,7 @@ public function testMatchScoreEndpoint() {

$this->mockResponse('{"id":"1-1","scores":{"red":169331,"blue":246780,"green":216241}}');
$this->assertEquals(169331, $endpoint->world(1008)->scores->red);
$this->assertEquals('world=1008', $this->getLastRequest()->getUri()->getQuery());
}

public function testMatchStatEndpoint() {
Expand All @@ -67,6 +70,7 @@ public function testMatchStatEndpoint() {

$this->mockResponse('{"id":"1-1","deaths":{"red":7276,"blue":5922,"green":5767}}');
$this->assertEquals(7276, $endpoint->world(1008)->deaths->red);
$this->assertEquals('world=1008', $this->getLastRequest()->getUri()->getQuery());
}

public function testRankEndpoint() {
Expand Down

0 comments on commit 10aac58

Please sign in to comment.