Skip to content

Commit

Permalink
Updating inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Jan 29, 2014
1 parent 7c57e63 commit 5f37923
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
4 changes: 3 additions & 1 deletion test/Tmdb/Tests/Api/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 3 additions & 14 deletions test/Tmdb/Tests/Factory/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion test/Tmdb/Tests/Repository/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 19 additions & 0 deletions test/Tmdb/Tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
);
}
}

0 comments on commit 5f37923

Please sign in to comment.