From cd55b150b1f58f936a851511cd085e2597d3422c Mon Sep 17 00:00:00 2001 From: Dan Rovito Date: Sat, 16 Jul 2016 23:28:10 -0400 Subject: [PATCH] tests --- composer.json | 57 +++++++++++++++++++++++--------------------- tests/ClientTest.php | 25 +------------------ 2 files changed, 31 insertions(+), 51 deletions(-) diff --git a/composer.json b/composer.json index d39075b..9c5c21e 100644 --- a/composer.json +++ b/composer.json @@ -1,31 +1,34 @@ { - "name": "danrovito/pokephp", - "description": "Pokeapi PHP Wrapper", - "keywords": [ - "pokemon", - "php", - "pokeapi" - ], - "license": "MIT", - "authors": [ - { - "name": "Dan Rovito", - "email": "danrovito@gmail.com" - } - ], - "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": "danrovito@gmail.com" + } + ], + "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" + } } - } } diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 518393d..3e6480c 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -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'); } }