From ddc0af336d86b1ae32a9f7e3a16055abd1c07a57 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Wed, 26 Feb 2014 20:59:29 +0100 Subject: [PATCH] Updating unit tests --- lib/Tmdb/Factory/AccountFactory.php | 32 ++- .../Tmdb/Tests/Factory/AccountFactoryTest.php | 164 +++++++++++++ .../Factory/AuthenticationFactoryTest.php | 101 ++++++++ .../Tmdb/Tests/Factory/ChangesFactoryTest.php | 5 +- .../AuthenticationRepositoryTest.php | 13 +- .../Tests/Repository/MovieRepositoryTest.php | 20 ++ .../Tests/Resources/account/favorite.json | 4 + .../Resources/account/favorite_movies.json | 207 ++++++++++++++++ test/Tmdb/Tests/Resources/account/get.json | 8 + test/Tmdb/Tests/Resources/account/lists.json | 157 ++++++++++++ .../Resources/account/movie_watchlist.json | 207 ++++++++++++++++ .../Tests/Resources/account/rated_movies.json | 227 ++++++++++++++++++ .../Tests/Resources/account/watchlist.json | 4 + .../authentication/guest_session_token.json | 5 + .../authentication/request_token.json | 5 + .../authentication/session_token.json | 4 + 16 files changed, 1157 insertions(+), 6 deletions(-) create mode 100644 test/Tmdb/Tests/Factory/AccountFactoryTest.php create mode 100644 test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php create mode 100644 test/Tmdb/Tests/Resources/account/favorite.json create mode 100644 test/Tmdb/Tests/Resources/account/favorite_movies.json create mode 100644 test/Tmdb/Tests/Resources/account/get.json create mode 100644 test/Tmdb/Tests/Resources/account/lists.json create mode 100644 test/Tmdb/Tests/Resources/account/movie_watchlist.json create mode 100644 test/Tmdb/Tests/Resources/account/rated_movies.json create mode 100644 test/Tmdb/Tests/Resources/account/watchlist.json create mode 100644 test/Tmdb/Tests/Resources/authentication/guest_session_token.json create mode 100644 test/Tmdb/Tests/Resources/authentication/request_token.json create mode 100644 test/Tmdb/Tests/Resources/authentication/session_token.json diff --git a/lib/Tmdb/Factory/AccountFactory.php b/lib/Tmdb/Factory/AccountFactory.php index 3b1559f9..ef481754 100644 --- a/lib/Tmdb/Factory/AccountFactory.php +++ b/lib/Tmdb/Factory/AccountFactory.php @@ -23,9 +23,15 @@ class AccountFactory extends AbstractFactory */ private $movieFactory; + /** + * @var ImageFactory + */ + private $imageFactory; + public function __construct() { $this->movieFactory = new MovieFactory(); + $this->imageFactory = new ImageFactory(); } /** @@ -66,7 +72,13 @@ public function createMovie(array $data = array()) { */ public function createListItem(array $data = array()) { - return $this->hydrate(new Account\ListItem(), $data); + $listItem = new Account\ListItem(); + + if (array_key_exists('poster_path', $data)) { + $listItem->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')); + } + + return $this->hydrate($listItem, $data); } /** @@ -94,4 +106,22 @@ public function getMovieFactory() { return $this->movieFactory; } + + /** + * @param \Tmdb\Factory\ImageFactory $imageFactory + * @return $this + */ + public function setImageFactory($imageFactory) + { + $this->imageFactory = $imageFactory; + return $this; + } + + /** + * @return \Tmdb\Factory\ImageFactory + */ + public function getImageFactory() + { + return $this->imageFactory; + } } diff --git a/test/Tmdb/Tests/Factory/AccountFactoryTest.php b/test/Tmdb/Tests/Factory/AccountFactoryTest.php new file mode 100644 index 00000000..09610e23 --- /dev/null +++ b/test/Tmdb/Tests/Factory/AccountFactoryTest.php @@ -0,0 +1,164 @@ + + * @copyright (c) 2013, Michael Roterman + * @version 0.0.1 + */ +namespace Tmdb\Tests\Factory; + +use Tmdb\Factory\AccountFactory; +use Tmdb\Model\Account; +use Tmdb\Model\Collection\ResultCollection; + +class AccountFactoryTest extends TestCase +{ + /** + * @test + */ + public function shouldGetAccount() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + /** + * @var Account $account + */ + $account = $factory->create($this->loadByFile('account/get.json')); + + $this->assertEquals(36, $account->getId()); + $this->assertEquals(false, $account->getIncludeAdult()); + $this->assertEquals('US', $account->getIso31661()); + $this->assertEquals('en', $account->getIso6391()); + $this->assertEquals('John Doe', $account->getName()); + $this->assertEquals('johndoe', $account->getUsername()); + } + + /** + * @test + */ + public function shouldGetLists() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + /** + * @var ResultCollection $collection + */ + $collection = $factory->createResultCollection($this->loadByFile('account/lists.json'), 'createListItem'); + + $this->assertInstanceOf('Tmdb\Model\Collection\ResultCollection', $collection); + $this->assertEquals(1, $collection->getPage()); + $this->assertEquals(1, $collection->getTotalPages()); + $this->assertEquals(15, $collection->getTotalResults()); + } + + /** + * @test + */ + public function shouldGetFavoriteMovies() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + /** + * @var ResultCollection $collection + */ + $collection = $factory->createResultCollection($this->loadByFile('account/favorite_movies.json'), 'createMovie'); + + $this->assertInstanceOf('Tmdb\Model\Collection\ResultCollection', $collection); + $this->assertEquals(1, $collection->getPage()); + $this->assertEquals(2, $collection->getTotalPages()); + $this->assertEquals(34, $collection->getTotalResults()); + } + + /** + * @test + */ + public function shouldCreateStatus() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + $status = $factory->createStatusResult($this->loadByFile('account/favorite.json')); + + $this->assertEquals(12, $status->getStatusCode()); + $this->assertEquals('The item/record was updated successfully', $status->getStatusMessage()); + } + + /** + * @test + */ + public function shouldGetRatedMovies() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + /** + * @var ResultCollection $collection + */ + $collection = $factory->createResultCollection($this->loadByFile('account/rated_movies.json'), 'createMovie'); + + $this->assertInstanceOf('Tmdb\Model\Collection\ResultCollection', $collection); + $this->assertEquals(1, $collection->getPage()); + $this->assertEquals(12, $collection->getTotalPages()); + $this->assertEquals(239, $collection->getTotalResults()); + } + + /** + * @test + */ + public function shouldGetMovieWatchlist() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + /** + * @var ResultCollection $collection + */ + $collection = $factory->createResultCollection($this->loadByFile('account/movie_watchlist.json'), 'createMovie'); + + $this->assertInstanceOf('Tmdb\Model\Collection\ResultCollection', $collection); + $this->assertEquals(1, $collection->getPage()); + $this->assertEquals(4, $collection->getTotalPages()); + $this->assertEquals(67, $collection->getTotalResults()); + } + + /** + * @test + */ + public function shouldWatchlist() + { + /** + * @var AccountFactory $factory + */ + $factory = $this->getFactory(); + + $status = $factory->createStatusResult($this->loadByFile('account/watchlist.json')); + + $this->assertEquals(1, $status->getStatusCode()); + $this->assertEquals('Success', $status->getStatusMessage()); + } + + protected function getFactoryClass() + { + return 'Tmdb\Factory\AccountFactory'; + } +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php b/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php new file mode 100644 index 00000000..028dfd58 --- /dev/null +++ b/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php @@ -0,0 +1,101 @@ + + * @copyright (c) 2013, Michael Roterman + * @version 0.0.1 + */ +namespace Tmdb\Tests\Factory; + +use Tmdb\Factory\AuthenticationFactory; + +class AuthenticationFactoryTest extends TestCase +{ + /** + * @test + */ + public function shouldCreateRequestToken() + { + /** + * @var AuthenticationFactory $factory + */ + $factory = $this->getFactory(); + + $token = $factory->createRequestToken($this->loadByFile('authentication/request_token.json')); + + $this->assertEquals('09-02-2012', $token->getExpiresAt()->format('d-m-Y')); + $this->assertEquals('641bf16c663db167c6cffcdff41126039d4445bf', $token->getToken()); + $this->assertEquals(true, $token->getSuccess()); + } + + /** + * @test + */ + public function shouldCreateSessionToken() + { + /** + * @var AuthenticationFactory $factory + */ + $factory = $this->getFactory(); + + $token = $factory->createSessionToken($this->loadByFile('authentication/session_token.json')); + + $this->assertEquals('80b2bf99520cd795ff54e31af97917bc9e3a7c8c', $token->getToken()); + $this->assertEquals(true, $token->getSuccess()); + } + + /** + * @test + */ + public function shouldCreateGuestSessionToken() + { + /** + * @var AuthenticationFactory $factory + */ + $factory = $this->getFactory(); + + $token = $factory->createGuestSessionToken($this->loadByFile('authentication/guest_session_token.json')); + + $this->assertEquals('04-12-2012', $token->getExpiresAt()->format('d-m-Y')); + $this->assertEquals('0c550fd5da2fc3f321ab3bs9b60ca108', $token->getToken()); + $this->assertEquals(true, $token->getSuccess()); + } + + /** + * @test + * @expectedException \Tmdb\Exception\NotImplementedException + */ + public function shouldThrowExceptionForCreate() + { + /** + * @var AuthenticationFactory $factory + */ + $factory = $this->getFactory(); + + $factory->create(array()); + } + + /** + * @test + * @expectedException \Tmdb\Exception\NotImplementedException + */ + public function shouldThrowExceptionForCreateCollection() + { + /** + * @var AuthenticationFactory $factory + */ + $factory = $this->getFactory(); + + $factory->createCollection(array()); + } + + protected function getFactoryClass() + { + return 'Tmdb\Factory\AuthenticationFactory'; + } +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Factory/ChangesFactoryTest.php b/test/Tmdb/Tests/Factory/ChangesFactoryTest.php index b3c0cb59..5524238c 100644 --- a/test/Tmdb/Tests/Factory/ChangesFactoryTest.php +++ b/test/Tmdb/Tests/Factory/ChangesFactoryTest.php @@ -14,12 +14,9 @@ use Tmdb\Factory\CompanyFactory; use Tmdb\Model\Collection\Changes; -use Tmdb\Model\Company; class ChangesFactoryTest extends TestCase { - const COMPANY_ID = 1; - private $data; /** @@ -37,7 +34,7 @@ public function setUp() $factory = $this->getFactory(); /** - * @var Company $company + * @var Changes $changes */ $this->changes = $factory->createCollection($this->data); } diff --git a/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php b/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php index d2c6995e..085f26f1 100644 --- a/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php +++ b/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php @@ -16,7 +16,6 @@ use Tmdb\Model\Movie; use Tmdb\Repository\AuthenticationRepository; use Tmdb\RequestToken; -use Tmdb\SessionToken; class AuthenticationRepositoryTest extends TestCase { @@ -42,6 +41,18 @@ public function shouldGetSessionToken() $repository->getSessionToken($token); } + /** + * @test + */ + public function shouldAuthenticateRequestToken() + { + $repository = $this->getRepositoryWithMockedHttpClient(); + + $token = new RequestToken('test'); + + $repository->getSessionToken($token); + } + /** * @test */ diff --git a/test/Tmdb/Tests/Repository/MovieRepositoryTest.php b/test/Tmdb/Tests/Repository/MovieRepositoryTest.php index 33c66db1..d306d699 100644 --- a/test/Tmdb/Tests/Repository/MovieRepositoryTest.php +++ b/test/Tmdb/Tests/Repository/MovieRepositoryTest.php @@ -189,6 +189,26 @@ public function shouldGetTopRated() $repository->getTopRated(); } + /** + * @test + */ + public function shouldGetAccountStates() + { + $repository = $this->getRepositoryWithMockedHttpClient(); + + $repository->getAccountStates('id'); + } + + /** + * @test + */ + public function shouldRate() + { + $repository = $this->getRepositoryWithMockedHttpClient(); + + $repository->rate('id', 5.2); + } + /** * @test */ diff --git a/test/Tmdb/Tests/Resources/account/favorite.json b/test/Tmdb/Tests/Resources/account/favorite.json new file mode 100644 index 00000000..0738a914 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/favorite.json @@ -0,0 +1,4 @@ +{ + "status_code": 12, + "status_message": "The item/record was updated successfully" +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/favorite_movies.json b/test/Tmdb/Tests/Resources/account/favorite_movies.json new file mode 100644 index 00000000..d670e300 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/favorite_movies.json @@ -0,0 +1,207 @@ +{ + "page": 1, + "results": [ + { + "backdrop_path": "/wrKcSXtHz4LedgEf1aW5e4ZVyHJ.jpg", + "id": 9806, + "original_title": "The Incredibles", + "release_date": "2004-11-05", + "poster_path": "/9k4sgKD79q0MDHSWIqNnHqOfOEV.jpg", + "title": "The Incredibles", + "vote_average": 8.5999999999999996, + "vote_count": 46 + }, + { + "backdrop_path": "/uAVdwu4vEx0TwuC4ewp9RqplKEV.jpg", + "id": 1452, + "original_title": "Superman Returns", + "release_date": "2006-06-21", + "poster_path": "/qpsarVxFcxJxtCK5dAoHLt3365R.jpg", + "title": "Superman Returns", + "vote_average": 6.5999999999999996, + "vote_count": 20 + }, + { + "backdrop_path": "/x9a4Q6Qlgh9Fk1f5z6K4r5OeLd9.jpg", + "id": 8960, + "original_title": "Hancock", + "release_date": "2008-07-02", + "poster_path": "/dsCxSr4w3g2ylhlZg3v5CB5Pid7.jpg", + "title": "Hancock", + "vote_average": 7.0, + "vote_count": 34 + }, + { + "backdrop_path": "/oPE44KcuRBKfuE15RD8sC2awh3P.jpg", + "id": 9741, + "original_title": "Unbreakable", + "release_date": "2000-11-14", + "poster_path": "/ndb1jugavBmgcfZKrfHXxC0T6al.jpg", + "title": "Unbreakable", + "vote_average": 7.7999999999999998, + "vote_count": 25 + }, + { + "backdrop_path": "/7u3pxc0K1wx32IleAkLv78MKgrw.jpg", + "id": 603, + "original_title": "The Matrix", + "release_date": "1999-03-31", + "poster_path": "/gynBNzwyaHKtXqlEKKLioNkjKgN.jpg", + "title": "The Matrix", + "vote_average": 9.0999999999999996, + "vote_count": 249 + }, + { + "backdrop_path": "/af98P1bc7lJsFjhHOVWXQgNNgSQ.jpg", + "id": 424, + "original_title": "Schindler's List", + "release_date": "1993-11-30", + "poster_path": "/I2lJ7ens7Rzlm3x5HfDbwF3ykh.jpg", + "title": "Schindler's List", + "vote_average": 8.6999999999999993, + "vote_count": 41 + }, + { + "backdrop_path": "/6kVVfNT0auG6fU5SFQ1zbayNWUC.jpg", + "id": 7191, + "original_title": "Cloverfield", + "release_date": "2008-01-16", + "poster_path": "/as01o40tJ2FhtheqeXf7bVZ0EQO.jpg", + "title": "Cloverfield", + "vote_average": 7.2000000000000002, + "vote_count": 35 + }, + { + "backdrop_path": "/6yFoLNQgFdVbA8TZMdfgVpszOla.jpg", + "id": 218, + "original_title": "The Terminator", + "release_date": "1984-10-26", + "poster_path": "/q8ffBuxQlYOHrvPniLgCbmKK4Lv.jpg", + "title": "The Terminator", + "vote_average": 8.5999999999999996, + "vote_count": 67 + }, + { + "backdrop_path": "/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg", + "id": 550, + "original_title": "Fight Club", + "release_date": "1999-10-15", + "poster_path": "/2lECpi35Hnbpa4y46JX0aY3AWTy.jpg", + "title": "Fight Club", + "vote_average": 9.0999999999999996, + "vote_count": 175 + }, + { + "backdrop_path": "/siKq2bQo09YGLTiqvKR1pXJ5li9.jpg", + "id": 23483, + "original_title": "Kick-Ass", + "release_date": "2010-04-16", + "poster_path": "/gtfggr5n3ED1neoTqVYmsVCoSS.jpg", + "title": "Kick-Ass", + "vote_average": 8.3000000000000007, + "vote_count": 108 + }, + { + "backdrop_path": "/419GfpzSip2cXf17x8FKIRHSSPK.jpg", + "id": 679, + "original_title": "Aliens", + "release_date": "1986-07-18", + "poster_path": "/qet8RDq99dRteBfSRfGeZeqY9xe.jpg", + "title": "Aliens", + "vote_average": 8.8000000000000007, + "vote_count": 107 + }, + { + "backdrop_path": "/sCtmAY3DgrFOjlrDh6mP7luUO7t.jpg", + "id": 489, + "original_title": "Good Will Hunting", + "release_date": "1997-12-05", + "poster_path": "/3yHtbRfp32AouPSwYESoJM3cOeQ.jpg", + "title": "Good Will Hunting", + "vote_average": 8.8000000000000007, + "vote_count": 32 + }, + { + "backdrop_path": "/5YF6MwuuKBRKLUE2dz3wetkgxAE.jpg", + "id": 453, + "original_title": "A Beautiful Mind", + "release_date": "2001-12-13", + "poster_path": "/79L8f0qbawvmdXE4ThVstC5sOxP.jpg", + "title": "A Beautiful Mind", + "vote_average": 8.5, + "vote_count": 28 + }, + { + "backdrop_path": "/bYtrTSGDqvd2KlHTO78b4Y3S4E9.jpg", + "id": 807, + "original_title": "Se7en", + "release_date": "1995-09-22", + "poster_path": "/zgB9CCTDlXRv50Z70ZI4elJtNEk.jpg", + "title": "Se7en", + "vote_average": 8.9000000000000004, + "vote_count": 96 + }, + { + "backdrop_path": "/6HbOqP1GUElNLdX8Bx2uP542CIP.jpg", + "id": 180, + "original_title": "Minority Report", + "release_date": "2002-06-21", + "poster_path": "/h3lpltSn7Rj1eYTPQO1lYGdw4Bz.jpg", + "title": "Minority Report", + "vote_average": 8.3000000000000007, + "vote_count": 34 + }, + { + "backdrop_path": "/i9A0UMFg1hI2kLyCCwnmSbpT2cd.jpg", + "id": 73, + "original_title": "American History X", + "release_date": "1998-10-30", + "poster_path": "/fXepRAYOx1qC3wju7XdDGx60775.jpg", + "title": "American History X", + "vote_average": 8.6999999999999993, + "vote_count": 61 + }, + { + "backdrop_path": "/5XPPB44RQGfkBrbJxmtdndKz05n.jpg", + "id": 19995, + "original_title": "Avatar", + "release_date": "2009-12-18", + "poster_path": "/s66l83fTQp0FAJsJqY0xUmkamcx.jpg", + "title": "Avatar", + "vote_average": 7.9000000000000004, + "vote_count": 516 + }, + { + "backdrop_path": "/e1uECwkwbD5Zpm9Gc6eb5mbG4C4.jpg", + "id": 38, + "original_title": "Eternal Sunshine of the Spotless Mind", + "release_date": "2004-03-19", + "poster_path": "/gutwXkVChJkpIrclokNESybj0GC.jpg", + "title": "Eternal Sunshine of the Spotless Mind", + "vote_average": 8.6999999999999993, + "vote_count": 57 + }, + { + "backdrop_path": "/tv8J6uCTKsTlASa8luJqrFiJlBX.jpg", + "id": 78, + "original_title": "Blade Runner", + "release_date": "1982-06-25", + "poster_path": "/ewq1lwhOT8GqBcQH1w8D1BagwTh.jpg", + "title": "Blade Runner", + "vote_average": 9.0, + "vote_count": 147 + }, + { + "backdrop_path": "/2nFyTvssbtJMLC6eyYwwZ88gALD.jpg", + "id": 10681, + "original_title": "WALL·E", + "release_date": "2008-06-27", + "poster_path": "/9cJETuLMc6R0bTWRA5i7ctY9bxk.jpg", + "title": "WALL·E", + "vote_average": 8.6999999999999993, + "vote_count": 164 + } + ], + "total_pages": 2, + "total_results": 34 +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/get.json b/test/Tmdb/Tests/Resources/account/get.json new file mode 100644 index 00000000..a8f30552 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/get.json @@ -0,0 +1,8 @@ +{ + "id": 36, + "include_adult": false, + "iso_3166_1": "US", + "iso_639_1": "en", + "name": "John Doe", + "username": "johndoe" +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/lists.json b/test/Tmdb/Tests/Resources/account/lists.json new file mode 100644 index 00000000..4e4b9249 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/lists.json @@ -0,0 +1,157 @@ +{ + "page": 1, + "results": [ + { + "description": "A list of \"frightful flicks waiting to be rediscovered\" -- compiled by the self-described leading name in the world of horror: Fangoria magazine.", + "favorite_count": 2, + "id": "50a6724919c295084b000028", + "item_count": 101, + "iso_639_1": "en", + "list_type": "movie", + "name": "Fangoria's 101 Best Horror Movies You've Never Seen", + "poster_path": "/3sL73Vy4kkrH4P61RA0n6UyYGlQ.jpg" + }, + { + "description": "Part of the AFI 100 Years… series, AFI's 100 Years…100 Thrills is a list of the top 100 heart-pounding movies in American cinema. The list was unveiled by the American Film Institute on June 12, 2001, during a CBS special hosted by Harrison Ford.", + "favorite_count": 2, + "id": "50a54d01760ee32e1400000b", + "item_count": 100, + "iso_639_1": "en", + "list_type": "movie", + "name": "AFI's 100 Most Thrilling American Films", + "poster_path": "/tayO4gCLyEo8Uul8FHkJGy3Kppb.jpg" + }, + { + "description": "A list of films that earned its actresses the Razzie Award for Worst Actress of the year.", + "favorite_count": 2, + "id": "509fca90760ee3490f000a12", + "item_count": 40, + "iso_639_1": "en", + "list_type": "movie", + "name": "Films featuring a Razzie winning Worst Actress Performance", + "poster_path": "/eL61XP1l8H0qrBPJoKqhXdxumkw.jpg" + }, + { + "description": "A list of all films in the Star Wars universe including the theatrical motion picture releases.", + "favorite_count": 2, + "id": "509fc02119c295114a0007cb", + "item_count": 14, + "iso_639_1": "en", + "list_type": "movie", + "name": "Star Wars Expanded Universe", + "poster_path": "/rf6uEcD5V8zs4J7Huo5L9sYgSki.jpg" + }, + { + "description": "Here's my list of best picture winners for the Oscars. Thought it would be neat to see them all together. There's a lot of movies here I have never even heard of.", + "favorite_count": 1, + "id": "509ec17c19c2950a0600050e", + "item_count": 84, + "iso_639_1": "en", + "list_type": "movie", + "name": "Best Picture Winners - The Academy Awards", + "poster_path": "/efBm2Nm2v5kQnO0w3hYcW6hVsJU.jpg" + }, + { + "description": "A list of the films that were nominated at the 2008 Oscars for best picture.", + "favorite_count": 1, + "id": "509ec007760ee36f0c000917", + "item_count": 5, + "iso_639_1": "en", + "list_type": "movie", + "name": "80th Academy Awards (2008) - Best Picture Nominations", + "poster_path": "/nWwFabqFaBbukXdkUCmtnrFxPNh.jpg" + }, + { + "description": "The View Askewniverse is a fictional universe created by writer/director Kevin Smith, featured in several films, comics and a television series; it is named for Smith's production company, View Askew Productions.", + "favorite_count": 2, + "id": "509691b119c29532730008fb", + "item_count": 6, + "iso_639_1": "en", + "list_type": "movie", + "name": "The View Askewniverse", + "poster_path": "/tGmU66LL8edoRm1RO7sbrz1xuhr.jpg" + }, + { + "description": "Name pretty much says it all, here's the top 50 grossing films of all time.", + "favorite_count": 2, + "id": "50957b1419c295013800023e", + "item_count": 50, + "iso_639_1": "en", + "list_type": "movie", + "name": "Top 50 Grossing Films of All Time (Worldwide)", + "poster_path": "/sRbZeVtRKIWybTOVpCRPZtzW5bd.jpg" + }, + { + "description": "A list of the films that were nominated at the 2009 Oscars for best picture.", + "favorite_count": 2, + "id": "50957064760ee3698a001fc1", + "item_count": 5, + "iso_639_1": "en", + "list_type": "movie", + "name": "81st Academy Awards (2009) - Best Picture Nominations", + "poster_path": "/gShtwIvdSHgCEQRZfymNkEUEwFm.jpg" + }, + { + "description": "A list of the films that were nominated at the 2010 Oscars for best picture.", + "favorite_count": 2, + "id": "50956fd2760ee3698a001fb1", + "item_count": 10, + "iso_639_1": "en", + "list_type": "movie", + "name": "82nd Academy Awards (2010) - Best Picture Nominations", + "poster_path": "/8iwe0iP49A6Gqcv31jBleZDZqI4.jpg" + }, + { + "description": "A list of the theatrical releases for Marvel's Avengers characters that are in the latest Avengers movie.", + "favorite_count": 3, + "id": "50953114760ee34b91000293", + "item_count": 7, + "iso_639_1": "en", + "list_type": "movie", + "name": "The Avengers", + "poster_path": "/2i89ujVkhJebuoB2zy6QZcwbr2N.jpg" + }, + { + "description": "A list of the films that were nominated at the 2011 Oscars for best picture.", + "favorite_count": 1, + "id": "509431ad19c2950b01000004", + "item_count": 10, + "iso_639_1": "en", + "list_type": "movie", + "name": "83rd Academy Awards (2011) - Best Picture Nominations", + "poster_path": "/iAHDZPyLD3NW7GuNV6U1TVtb0hN.jpg" + }, + { + "description": "Here's a list of the films that take place in the DC Comics universe.", + "favorite_count": 2, + "id": "5094147819c2955e4c00006b", + "item_count": 22, + "iso_639_1": "en", + "list_type": "movie", + "name": "The DC Comics Universe", + "poster_path": "/4H1jWsgEQOgTs4KeG5j5BorKMfX.jpg" + }, + { + "description": "A list of the films that were nominated at the 2012 Oscars for best picture.", + "favorite_count": 1, + "id": "50941340760ee35da9000054", + "item_count": 9, + "iso_639_1": "en", + "list_type": "movie", + "name": "84th Academy Awards (2012) - Best Picture Nominations", + "poster_path": "/zRqBleU93WncYnIwt8LAanQerZ7.jpg" + }, + { + "description": "The idea behind this list is to collect the live action comic book movies from within the Marvel franchise.", + "favorite_count": 5, + "id": "50941077760ee35e1500000d", + "item_count": 33, + "iso_639_1": "en", + "list_type": "movie", + "name": "The Marvel Universe", + "poster_path": "/w2JbuNpBnfevl0yCcYEm6vNFWdi.jpg" + } + ], + "total_pages": 1, + "total_results": 15 +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/movie_watchlist.json b/test/Tmdb/Tests/Resources/account/movie_watchlist.json new file mode 100644 index 00000000..383b62d3 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/movie_watchlist.json @@ -0,0 +1,207 @@ +{ + "page": 1, + "results": [ + { + "backdrop_path": "/xetk5vdoKxMIto5O5boqPGxWnoA.jpg", + "id": 76726, + "original_title": "Chronicle", + "release_date": "2012-02-03", + "poster_path": "/pSYRHYvOd8aFaddVUdyXJGZ8F6W.jpg", + "title": "Chronicle", + "vote_average": 7.2999999999999998, + "vote_count": 32 + }, + { + "backdrop_path": "/g9CDUXFBflsIch95wZxeNajTTX2.jpg", + "id": 70435, + "original_title": "Haywire", + "release_date": "2011-11-07", + "poster_path": "/8RlFYPPDFPr3ADrNHFGyB0JS6mo.jpg", + "title": "Haywire", + "vote_average": 6.9000000000000004, + "vote_count": 18 + }, + { + "backdrop_path": "/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg", + "id": 24428, + "original_title": "The Avengers", + "release_date": "2012-05-04", + "poster_path": "/cezWGskPY5x7GaglTTRN4Fugfb8.jpg", + "title": "The Avengers", + "vote_average": 8.5, + "vote_count": 117 + }, + { + "backdrop_path": "/5Jj4SpbsxmH2yOlhka4LvNRtSud.jpg", + "id": 22970, + "original_title": "The Cabin in the Woods", + "release_date": "2012-04-13", + "poster_path": "/t8cW3FSCDYCaWRiNHSvI6SDuWeA.jpg", + "title": "The Cabin in the Woods", + "vote_average": 6.9000000000000004, + "vote_count": 22 + }, + { + "backdrop_path": "/8iNsXY3LPsuT0gnUiTBMoNuRZI7.jpg", + "id": 52520, + "original_title": "Underworld: Awakening", + "release_date": "2012-01-20", + "poster_path": "/76GXWKs2IDi0ZERKLT57wkToV0A.jpg", + "title": "Underworld: Awakening", + "vote_average": 7.5, + "vote_count": 36 + }, + { + "backdrop_path": "/gVfnoiCJBdv2SN7poIbU7eyNVq1.jpg", + "id": 12437, + "original_title": "Underworld: Rise of the Lycans", + "release_date": "2009-01-23", + "poster_path": "/hZtK6fkusSKzGc0f7yQ2syo14Ze.jpg", + "title": "Underworld: Rise of the Lycans", + "vote_average": 7.2999999999999998, + "vote_count": 30 + }, + { + "backdrop_path": "/LvmmDZxkTDqp0DX7mUo621ahdX.jpg", + "id": 10195, + "original_title": "Thor", + "release_date": "2011-05-06", + "poster_path": "/jqcMUV73jEhO0gv5yi28FD8JbHQ.jpg", + "title": "Thor", + "vote_average": 7.2000000000000002, + "vote_count": 79 + }, + { + "backdrop_path": "/1ueWzFe8Klk5WDurB5j8yl5qdaq.jpg", + "id": 1771, + "original_title": "Captain America: The First Avenger", + "release_date": "2011-07-22", + "poster_path": "/sBZs1jSybBRBXDwcCR8IOyHLUMc.jpg", + "title": "Captain America: The First Avenger", + "vote_average": 7.5, + "vote_count": 73 + }, + { + "backdrop_path": "/uOpFdld7CIifSEoGuRVgWqaeyFs.jpg", + "id": 64688, + "original_title": "21 Jump Street", + "release_date": "2012-05-10", + "poster_path": "/mH6xazzfGdszadd1Xy9JgdZYvn1.jpg", + "title": "21 Jump Street", + "vote_average": 7.5, + "vote_count": 25 + }, + { + "backdrop_path": "/9mnDfS7nuja6wCGK5bBG3412Qdo.jpg", + "id": 17578, + "original_title": "The Adventures of Tintin", + "release_date": "2011-10-26", + "poster_path": "/7NwqKqEqJDmFP8hkLBpV0Sk6xek.jpg", + "title": "The Adventures of Tintin", + "vote_average": 7.7000000000000002, + "vote_count": 47 + }, + { + "backdrop_path": "/wX0mOAa91dTAT2WCGRvvpWUKAeD.jpg", + "id": 59961, + "original_title": "Safe House", + "release_date": "2012-02-16", + "poster_path": "/itJBQuozyehzoTh0X4YpKwIiFLy.jpg", + "title": "Safe House", + "vote_average": 7.5999999999999996, + "vote_count": 39 + }, + { + "backdrop_path": "/elnVoZPBXwGVh5xD5PLbvIzmvOZ.jpg", + "id": 8967, + "original_title": "The Tree of Life", + "release_date": "2011-05-27", + "poster_path": "/5uiccn657MLiAbVHS5SfWFdeSTw.jpg", + "title": "The Tree of Life", + "vote_average": 7.4000000000000004, + "vote_count": 19 + }, + { + "backdrop_path": "/cnGPiAd7D50YFcpt6HK7CwTUCew.jpg", + "id": 49530, + "original_title": "In Time", + "release_date": "2011-10-28", + "poster_path": "/lnYuAr3QOPzvuEFlzpsRUq41IEy.jpg", + "title": "In Time", + "vote_average": 6.9000000000000004, + "vote_count": 54 + }, + { + "backdrop_path": "/1qQiuN2QlBR3VmIwqBXYFGCCZbl.jpg", + "id": 49527, + "original_title": "Man on a Ledge", + "release_date": "2012-01-27", + "poster_path": "/ssl4ZcThbMtEPNBEXmWpSgtT9xK.jpg", + "title": "Man on a Ledge", + "vote_average": 7.2000000000000002, + "vote_count": 16 + }, + { + "backdrop_path": "/gxbO2y8jeEvwGHDLC8ErqSf61ca.jpg", + "id": 80389, + "original_title": "Get the Gringo", + "release_date": "2012-05-01", + "poster_path": "/6yo4E8B0WbIpiHbY01Dq8r6dH8V.jpg", + "title": "Get the Gringo", + "vote_average": 7.7000000000000002, + "vote_count": 8 + }, + { + "backdrop_path": "/pbYQevN15y5aEusvcsp3bpuu5Ip.jpg", + "id": 65754, + "original_title": "The Girl with the Dragon Tattoo", + "release_date": "2011-12-21", + "poster_path": "/voxRWFTtagLiqnJQs9tWQLB0MN.jpg", + "title": "The Girl with the Dragon Tattoo", + "vote_average": 7.9000000000000004, + "vote_count": 49 + }, + { + "backdrop_path": "/3DdCnPuMq5QRXRE4PMrI3VEQI94.jpg", + "id": 13007, + "original_title": "Religulous", + "release_date": "2008-10-01", + "poster_path": "/lGo6P1rEs1GJnYJW9a6whlcljtZ.jpg", + "title": "Religulous", + "vote_average": 7.4000000000000004, + "vote_count": 4 + }, + { + "backdrop_path": "/wWwHt3NvdnGLXrGRR4n7GU6ISkh.jpg", + "id": 64690, + "original_title": "Drive", + "release_date": "2012-01-26", + "poster_path": "/fsnaaNQ4RmZwgRv6qfT7NIi41Sj.jpg", + "title": "Drive", + "vote_average": 7.7999999999999998, + "vote_count": 80 + }, + { + "backdrop_path": "/dNdrWdlOEuisZ1YyafkkPEWAihn.jpg", + "id": 12690, + "original_title": "Appaloosa", + "release_date": "2008-10-03", + "poster_path": "/5Ql3TsG08yvVBDyV5azOWUVKmuy.jpg", + "title": "Appaloosa", + "vote_average": 7.4000000000000004, + "vote_count": 13 + }, + { + "backdrop_path": "/7u3UyejCbhM3jXcZ86xzA9JJxge.jpg", + "id": 41154, + "original_title": "Men in Black 3", + "release_date": "2012-05-25", + "poster_path": "/sIuneIyme2O3qYxEZTVNyJ0F0LC.jpg", + "title": "Men in Black 3", + "vote_average": 7.5, + "vote_count": 27 + } + ], + "total_pages": 4, + "total_results": 67 +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/rated_movies.json b/test/Tmdb/Tests/Resources/account/rated_movies.json new file mode 100644 index 00000000..151d4929 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/rated_movies.json @@ -0,0 +1,227 @@ +{ + "page": 1, + "results": [ + { + "backdrop_path": "/tjMZ4RBLhvk670gYJPxIN8SBfnB.jpg", + "id": 13, + "original_title": "Forrest Gump", + "release_date": "1994-06-23", + "poster_path": "/iZvCkb34CAmV9BETIrHY4yiS115.jpg", + "rating": 8.0, + "title": "Forrest Gump", + "vote_average": 8.9000000000000004, + "vote_count": 84 + }, + { + "backdrop_path": "/e1uECwkwbD5Zpm9Gc6eb5mbG4C4.jpg", + "id": 38, + "original_title": "Eternal Sunshine of the Spotless Mind", + "release_date": "2004-03-19", + "poster_path": "/gutwXkVChJkpIrclokNESybj0GC.jpg", + "rating": 9.0, + "title": "Eternal Sunshine of the Spotless Mind", + "vote_average": 8.6999999999999993, + "vote_count": 57 + }, + { + "backdrop_path": "/gTFGr8q5YzYYiRyDYaEMNB6QRuL.jpg", + "id": 106, + "original_title": "Predator", + "release_date": "1987-06-12", + "poster_path": "/gUpto7r2XwoM5eW7MUvd8hl1etB.jpg", + "rating": 6.0, + "title": "Predator", + "vote_average": 8.4000000000000004, + "vote_count": 49 + }, + { + "backdrop_path": "/cNLZ7YGRikb4IsLblrzu86ndZPw.jpg", + "id": 107, + "original_title": "Snatch", + "release_date": "2000-12-06", + "poster_path": "/on9JlbGEccLsYkjeEph2Whm1DIp.jpg", + "rating": 8.0, + "title": "Snatch", + "vote_average": 8.5999999999999996, + "vote_count": 55 + }, + { + "backdrop_path": "/pIUvQ9Ed35wlWhY2oU6OmwEsmzG.jpg", + "id": 120, + "original_title": "The Lord of the Rings: The Fellowship of the Ring", + "release_date": "2001-12-19", + "poster_path": "/9HG6pINW1KoFTAKY3LdybkoOKAm.jpg", + "rating": 8.0, + "title": "The Lord of the Rings: The Fellowship of the Ring", + "vote_average": 8.8000000000000007, + "vote_count": 125 + }, + { + "backdrop_path": "/nnMC0BM6XbjIIrT4miYmMtPGcQV.jpg", + "id": 155, + "original_title": "The Dark Knight", + "release_date": "2008-07-18", + "poster_path": "/1hRoyzDtpgMU7Dz4JF22RANzQO7.jpg", + "rating": 9.0, + "title": "The Dark Knight", + "vote_average": 8.8000000000000007, + "vote_count": 269 + }, + { + "backdrop_path": "/uv5BRIaJKfcPBPEBV8qfTjD6PuY.jpg", + "id": 12, + "original_title": "Finding Nemo", + "release_date": "2003-05-30", + "poster_path": "/zjqInUwldOBa0q07fOyohYCWxWX.jpg", + "rating": 8.0, + "title": "Finding Nemo", + "vote_average": 8.6999999999999993, + "vote_count": 41 + }, + { + "backdrop_path": "/kriCxQiDhdosxzYXEf5JApMdmyq.jpg", + "id": 187, + "original_title": "Sin City", + "release_date": "2005-04-01", + "poster_path": "/eCJkepVJslq1nEtqURLaC1zLPAL.jpg", + "rating": 8.0, + "title": "Sin City", + "vote_average": 8.4000000000000004, + "vote_count": 64 + }, + { + "backdrop_path": "/6xKCYgH16UuwEGAyroLU6p8HLIn.jpg", + "id": 238, + "original_title": "The Godfather", + "release_date": "1972-03-24", + "poster_path": "/d4KNaTrltq6bpkFS01pYtyXa09m.jpg", + "rating": 9.0, + "title": "The Godfather", + "vote_average": 9.1999999999999993, + "vote_count": 125 + }, + { + "backdrop_path": "/iX99sWgGZCnjPpDgG29E0HomMLI.jpg", + "id": 275, + "original_title": "Fargo", + "release_date": "1996-03-15", + "poster_path": "/gO0Q7TMuu8PJ9Y736VTgvY02rVD.jpg", + "rating": 8.0, + "title": "Fargo", + "vote_average": 8.1999999999999993, + "vote_count": 29 + }, + { + "backdrop_path": "/d9AqtruwS8nljKjL5aYzM42hQJr.jpg", + "id": 280, + "original_title": "Terminator 2: Judgment Day", + "release_date": "1991-07-01", + "poster_path": "/2y4dmgWYRMYXdD1UyJVcn2HSd1D.jpg", + "rating": 8.0, + "title": "Terminator 2: Judgment Day", + "vote_average": 9.0999999999999996, + "vote_count": 106 + }, + { + "backdrop_path": "/xRqsFFteJrvLHxswk78NzU7zOrU.jpg", + "id": 289, + "original_title": "Casablanca", + "release_date": "1942-11-26", + "poster_path": "/sm1QVZu5RKe1vXVHZooo4SZyHMx.jpg", + "rating": 8.0, + "title": "Casablanca", + "vote_average": 8.5, + "vote_count": 27 + }, + { + "backdrop_path": "/heNbD1JojBNz6kfHWr3O8Uk0a3a.jpg", + "id": 296, + "original_title": "Terminator 3: Rise of the Machines", + "release_date": "2003-06-30", + "poster_path": "/lz4xYdF1n09lyiCfZWtWT44SZiG.jpg", + "rating": 7.0, + "title": "Terminator 3: Rise of the Machines", + "vote_average": 6.7000000000000002, + "vote_count": 44 + }, + { + "backdrop_path": "/wH8vtnsmU4olFJ5wSRHo8RXRhKF.jpg", + "id": 310, + "original_title": "Bruce Almighty", + "release_date": "2003-05-23", + "poster_path": "/oHA5eAeJh7ChPsHnSsppNx4ta6L.jpg", + "rating": 8.0, + "title": "Bruce Almighty", + "vote_average": 7.7000000000000002, + "vote_count": 25 + }, + { + "backdrop_path": "/tUGSLoMcxNWZ0OIRSqDaB2jNbdE.jpg", + "id": 503, + "original_title": "Poseidon", + "release_date": "2006-05-12", + "poster_path": "/kHrdehzlhyyb190D3RvH8mdX1y2.jpg", + "rating": 6.0, + "title": "Poseidon", + "vote_average": 6.2000000000000002, + "vote_count": 9 + }, + { + "backdrop_path": "/tBCOpjphzSLzC6oOjqzTEg6bJ7q.jpg", + "id": 534, + "original_title": "Terminator Salvation", + "release_date": "2009-05-21", + "poster_path": "/hxDfhavtxA2Ayx7O9BsQMcZRdG0.jpg", + "rating": 6.0, + "title": "Terminator Salvation", + "vote_average": 7.0, + "vote_count": 57 + }, + { + "backdrop_path": "/6TlMTnjtBcXFq7rSCcdQoBjTNPd.jpg", + "id": 571, + "original_title": "The Birds", + "release_date": "1963-03-28", + "poster_path": "/8tGRhGAbIZE97bnUAWrYSdqq71t.jpg", + "rating": 6.0, + "title": "The Birds", + "vote_average": 8.0999999999999996, + "vote_count": 6 + }, + { + "backdrop_path": "/7u3pxc0K1wx32IleAkLv78MKgrw.jpg", + "id": 603, + "original_title": "The Matrix", + "release_date": "1999-03-31", + "poster_path": "/gynBNzwyaHKtXqlEKKLioNkjKgN.jpg", + "rating": 9.0, + "title": "The Matrix", + "vote_average": 9.0999999999999996, + "vote_count": 249 + }, + { + "backdrop_path": "/jB9nQa6zJIZQ0htH5827Og7Mfsw.jpg", + "id": 615, + "original_title": "The Passion of the Christ", + "release_date": "2004-02-25", + "poster_path": "/6KyvP5bDmwTYdLLnhEn10NFPDIZ.jpg", + "rating": 6.0, + "title": "The Passion of the Christ", + "vote_average": 7.5, + "vote_count": 15 + }, + { + "backdrop_path": "/nO0GtGFQmEuuOyAQVpHjJlWBU8O.jpg", + "id": 616, + "original_title": "The Last Samurai", + "release_date": "2003-12-05", + "poster_path": "/cRz4FRx731ulws6zHuQVaDXpx73.jpg", + "rating": 8.0, + "title": "The Last Samurai", + "vote_average": 8.0999999999999996, + "vote_count": 26 + } + ], + "total_pages": 12, + "total_results": 239 +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/account/watchlist.json b/test/Tmdb/Tests/Resources/account/watchlist.json new file mode 100644 index 00000000..e36811f6 --- /dev/null +++ b/test/Tmdb/Tests/Resources/account/watchlist.json @@ -0,0 +1,4 @@ +{ + "status_code": 1, + "status_message": "Success" +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/authentication/guest_session_token.json b/test/Tmdb/Tests/Resources/authentication/guest_session_token.json new file mode 100644 index 00000000..9e0e7eaf --- /dev/null +++ b/test/Tmdb/Tests/Resources/authentication/guest_session_token.json @@ -0,0 +1,5 @@ +{ + "success": true, + "guest_session_id": "0c550fd5da2fc3f321ab3bs9b60ca108", + "expires_at": "2012-12-04 22:51:19 UTC" +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/authentication/request_token.json b/test/Tmdb/Tests/Resources/authentication/request_token.json new file mode 100644 index 00000000..9b57d6d4 --- /dev/null +++ b/test/Tmdb/Tests/Resources/authentication/request_token.json @@ -0,0 +1,5 @@ +{ + "expires_at": "2012-02-09 19:50:25 UTC", + "request_token": "641bf16c663db167c6cffcdff41126039d4445bf", + "success": true +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/authentication/session_token.json b/test/Tmdb/Tests/Resources/authentication/session_token.json new file mode 100644 index 00000000..cf074a32 --- /dev/null +++ b/test/Tmdb/Tests/Resources/authentication/session_token.json @@ -0,0 +1,4 @@ +{ + "session_id": "80b2bf99520cd795ff54e31af97917bc9e3a7c8c", + "success": true +} \ No newline at end of file