Skip to content

Commit

Permalink
Fix API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 22, 2014
1 parent dc4000f commit c2be7ec
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/Tmdb/Tests/Api/CertificationsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
namespace Tmdb\Tests\Api;

class CertificationsTest extends TestCase
{
/**
* @test
*/
public function shouldGetCertificationsListForMovies()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('certification/movie/list');

$api->getMovieList();
}

protected function getApiClass() {
return 'Tmdb\Api\Certifications';
}
}
33 changes: 33 additions & 0 deletions test/Tmdb/Tests/Api/CreditsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
namespace Tmdb\Tests\Api;

class CreditsTest extends TestCase
{
/**
* @test
*/
public function shouldGetCredit()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('credit/5240760b5dbf5b0c2c0139db');

$api->getCredit('5240760b5dbf5b0c2c0139db');
}

protected function getApiClass() {
return 'Tmdb\Api\Credits';
}
}
33 changes: 33 additions & 0 deletions test/Tmdb/Tests/Api/NetworksTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
namespace Tmdb\Tests\Api;

class NetworksTest extends TestCase
{
/**
* @test
*/
public function shouldGetCredit()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('network/49');

$api->getNetwork(49);
}

protected function getApiClass() {
return 'Tmdb\Api\Networks';
}
}
26 changes: 26 additions & 0 deletions test/Tmdb/Tests/Api/PeopleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@ public function shouldGetCredits()
$api->getCredits(self::PERSON_ID);
}

/**
* @test
*/
public function shouldGetMovieCredits()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('person/' . self::PERSON_ID . '/movie_credits');

$api->getMovieCredits(self::PERSON_ID);
}

/**
* @test
*/
public function shouldGetTvCredits()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('person/' . self::PERSON_ID . '/tv_credits');

$api->getTvCredits(self::PERSON_ID);
}

/**
* @test
*/
Expand Down
13 changes: 13 additions & 0 deletions test/Tmdb/Tests/Api/TvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ public function shouldGetImages()
$api->getImages(self::TV_ID);
}

/**
* @test
*/
public function shouldGetTranslations()
{
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('tv/' . self::TV_ID . '/translations');

$api->getTranslations(self::TV_ID);
}

/**
* @test
*/
Expand Down

0 comments on commit c2be7ec

Please sign in to comment.