Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danrovito committed Jul 17, 2016
1 parent dbc8ffc commit cd55b15
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 51 deletions.
57 changes: 30 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
{
"name": "danrovito/pokephp",
"description": "Pokeapi PHP Wrapper",
"keywords": [
"pokemon",
"php",
"pokeapi"
],
"license": "MIT",
"authors": [
{
"name": "Dan Rovito",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.3.3",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"autoload": {
"name": "danrovito/pokephp",
"description": "Pokeapi PHP Wrapper",
"keywords": [
"pokemon",
"php",
"pokeapi"
],
"license": "MIT",
"authors": [
{
"name": "Dan Rovito",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.3.3",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "4.8.*"
},
"autoload": {
"psr-4": { "PokePHP\\": "src/" }
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.0.0-dev"
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.0.0-dev"
}
}
}
}
25 changes: 1 addition & 24 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,6 @@ public function testBerry()

$response = $poke->berry('1');

//json files to match
$berryJson = json_decode('/responses/berry.json');
$responseJson = json_decode($response);

$this->assertTrue(json_match($responseJson, $berryJson));

//$this->assertJson($response, 'message');
}

//Check for matching json
public function json_match($a, $b)
{
if (count(array_diff_assoc($a, $b))) {
return false;
}
// we know that the indexes, but maybe not values, match.
// compare the values between the two arrays
foreach($a as $k => $v) {
if ($v !== $b[$k]) {
return false;
}
}
// we have identical indexes, and no unequal values
return true;
$this->assertJson($response, 'message');
}
}

0 comments on commit cd55b15

Please sign in to comment.