Skip to content

Commit

Permalink
Updating PeopleFactoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 2, 2014
1 parent ba0bb96 commit f38feb6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/Tmdb/Tests/Factory/PeopleFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*/
namespace Tmdb\Tests\Factory;

use Tmdb\Factory\MovieFactory;
use Tmdb\Factory\PeopleFactory;
use Tmdb\Model\Movie;
use Tmdb\Model\Person;

class PeopleFactoryTest extends TestCase
Expand All @@ -39,6 +41,32 @@ public function shouldConstructPerson()
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $person->getProfile());
}

/**
* @test
*/
public function shouldConstructCastAndCredits()
{
$data = $this->loadByFile('movie/all.json');
/**
* @var MovieFactory $movieFactory
*/
$movieFactory = new MovieFactory();

/**
* @var Movie $movie
*/
$movie = $movieFactory->create($data);
$credits = $movie->getCredits();

$this->assertInstanceOf('Tmdb\Model\Collection\Credits', $credits);

$cast = $credits->getCast();
$crew = $credits->getCrew();

$this->assertInstanceOf('Tmdb\Model\Collection\People\Cast', $cast);
$this->assertInstanceOf('Tmdb\Model\Collection\People\Crew', $crew);
}

protected function getFactoryClass()
{
return 'Tmdb\Factory\PeopleFactory';
Expand Down

0 comments on commit f38feb6

Please sign in to comment.