From 5f379235533fa2a73d2e7591c68373367e6a0f38 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Wed, 29 Jan 2014 02:37:38 +0100 Subject: [PATCH] Updating inheritance --- test/Tmdb/Tests/Api/TestCase.php | 4 +++- test/Tmdb/Tests/Factory/TestCase.php | 17 +++-------------- test/Tmdb/Tests/Repository/TestCase.php | 4 +++- test/Tmdb/Tests/TestCase.php | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/test/Tmdb/Tests/Api/TestCase.php b/test/Tmdb/Tests/Api/TestCase.php index d4888f3f..acde92d0 100644 --- a/test/Tmdb/Tests/Api/TestCase.php +++ b/test/Tmdb/Tests/Api/TestCase.php @@ -12,9 +12,11 @@ */ namespace Tmdb\Tests\Api; +use Tmdb\Tests\TestCase as Base; + use Tmdb\ApiToken; -abstract class TestCase extends \PHPUnit_Framework_TestCase +abstract class TestCase extends Base { private $_api = null; diff --git a/test/Tmdb/Tests/Factory/TestCase.php b/test/Tmdb/Tests/Factory/TestCase.php index 5b36e30c..aef33e44 100644 --- a/test/Tmdb/Tests/Factory/TestCase.php +++ b/test/Tmdb/Tests/Factory/TestCase.php @@ -12,23 +12,12 @@ */ namespace Tmdb\Tests\Factory; -abstract class TestCase extends \PHPUnit_Framework_TestCase +use Tmdb\Tests\TestCase as Base; + +abstract class TestCase extends Base { protected $factory; - protected function loadByFile($file) - { - return json_decode( - file_get_contents( - sprintf( - '%s/%s', - 'test/Tmdb/Tests/Resources/', - $file - ) - ) - ); - } - protected function getFactory() { $class = $this->getFactoryClass(); diff --git a/test/Tmdb/Tests/Repository/TestCase.php b/test/Tmdb/Tests/Repository/TestCase.php index 650d1073..5530c9c8 100644 --- a/test/Tmdb/Tests/Repository/TestCase.php +++ b/test/Tmdb/Tests/Repository/TestCase.php @@ -12,11 +12,13 @@ */ namespace Tmdb\Tests\Repository; +use Tmdb\Tests\TestCase as Base; + use Guzzle\Http\Message\Response; use Tmdb\ApiToken; use Tmdb\Client; -abstract class TestCase extends \PHPUnit_Framework_TestCase +abstract class TestCase extends Base { protected $repository; diff --git a/test/Tmdb/Tests/TestCase.php b/test/Tmdb/Tests/TestCase.php index 479fd8b3..0978b428 100644 --- a/test/Tmdb/Tests/TestCase.php +++ b/test/Tmdb/Tests/TestCase.php @@ -36,4 +36,23 @@ protected function assertInstancesOf($subject, array $instances = array()) } } } + + /** + * Load an json file from the Resources directory + * + * @param $file + * @return mixed + */ + protected function loadByFile($file) + { + return json_decode( + file_get_contents( + sprintf( + '%s/%s', + 'test/Tmdb/Tests/Resources/', + $file + ) + ) + ); + } }