Skip to content

Commit

Permalink
Updating MovieRepositoryTest and fixing a bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 23, 2014
1 parent 70f51aa commit bcacadc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
16 changes: 1 addition & 15 deletions lib/Tmdb/Factory/Movie/ListItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,7 @@ public function create(array $data = array())
*/
public function createCollection(array $data = array())
{
$collection = new ResultCollection();

$collection->setPage($data['page']);
$collection->setTotalPages($data['total_pages']);
$collection->setTotalResults($data['total_results']);

if (array_key_exists('results', $data)) {
$data = $data['results'];
}

foreach($data as $item) {
$collection->add(null, $this->create($item));
}

return $collection;
return $this->createResultCollection($data);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions test/Tmdb/Tests/Repository/MovieRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public function shouldGetReviews()
*/
public function shouldGetLists()
{
// $repository = $this->getRepositoryWithMockedHttpClient();
//
// $repository->getLists(self::MOVIE_ID);
$repository = $this->getRepositoryWithMockedHttpClient();

$repository->getLists(self::MOVIE_ID);
}

/**
Expand Down

0 comments on commit bcacadc

Please sign in to comment.