From c89dc450cfe93a0a2d1161f93b2f39681f0fec98 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 8 Feb 2014 02:45:21 +0100 Subject: [PATCH] Expanding test suite --- lib/Tmdb/Model/Collection/Images.php | 23 - test/Tmdb/Tests/Factory/ImageFactoryTest.php | 167 ++++ .../Tests/Model/Collection/PeopleTest.php | 4 +- test/Tmdb/Tests/Resources/images/movie.json | 142 +++ test/Tmdb/Tests/Resources/images/person.json | 26 + test/Tmdb/Tests/Resources/images/tv.json | 835 ++++++++++++++++++ .../Tests/Resources/images/tv_episode.json | 14 + .../Tests/Resources/images/tv_season.json | 131 +++ 8 files changed, 1317 insertions(+), 25 deletions(-) create mode 100644 test/Tmdb/Tests/Resources/images/movie.json create mode 100644 test/Tmdb/Tests/Resources/images/person.json create mode 100644 test/Tmdb/Tests/Resources/images/tv.json create mode 100644 test/Tmdb/Tests/Resources/images/tv_episode.json create mode 100644 test/Tmdb/Tests/Resources/images/tv_season.json diff --git a/lib/Tmdb/Model/Collection/Images.php b/lib/Tmdb/Model/Collection/Images.php index 17f2a631..3e2740d9 100644 --- a/lib/Tmdb/Model/Collection/Images.php +++ b/lib/Tmdb/Model/Collection/Images.php @@ -163,27 +163,4 @@ function($key, $value) use ($height) { } ); } - - /** - * Return a single image that is rated highest - * - * @return ImageFilter|null - */ - public function filterBestVotedImage() - { - $currentImage = null; - $voteAverage = 0; - - /** - * @var $image Image - */ - foreach($this as $image) { - if ($image instanceof ImageFilter && $image->getVoteAverage() > $voteAverage) { - $voteAverage = $image->getVoteAverage(); - $currentImage = $image; - } - } - - return $currentImage; - } } diff --git a/test/Tmdb/Tests/Factory/ImageFactoryTest.php b/test/Tmdb/Tests/Factory/ImageFactoryTest.php index 950816b7..45ce432d 100644 --- a/test/Tmdb/Tests/Factory/ImageFactoryTest.php +++ b/test/Tmdb/Tests/Factory/ImageFactoryTest.php @@ -12,8 +12,31 @@ */ namespace Tmdb\Tests\Factory; +use Tmdb\Model\Collection\Images; +use Tmdb\Model\Image; + class ImageFactoryTest extends TestCase { + /** + * @var Images + */ + private $images; + + public function setUp() + { + $factory = $this->getFactory(); + + $movieData = $this->loadByFile('images/movie.json'); + $tvData = $this->loadByFile('images/tv.json'); + $tvSeasonData = $this->loadByFile('images/tv_season.json'); + $tvEpisodeData = $this->loadByFile('images/tv_episode.json'); + $personData = $this->loadByFile('images/person.json'); + + $data = array_merge(array(), array($movieData, $tvData, $tvSeasonData, $tvEpisodeData, $personData)); + + $this->images = $factory->createCollection($data); + } + /** * @test */ @@ -31,6 +54,150 @@ public function shouldBeAbleToCreateCollection() $this->assertEquals(2, count($collection)); } + /** + * @test + */ + public function shouldFilterPosters() + { + $this->setUp(); + + $posters = $this->images->filterPosters(); + + foreach($posters as $poster) { + $this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $poster); + } + } + + /** + * @test + */ + public function shouldFilterBackdrops() + { + $this->setUp(); + + $backdrops = $this->images->filterBackdrops(); + + foreach($backdrops as $backdrop) { + $this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $backdrop); + } + } + + /** + * @test + */ + public function shouldFilterProfiles() + { + $this->setUp(); + + $profiles = $this->images->filterProfile(); + + foreach($profiles as $profile) { + $this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $profile); + } + } + + /** + * @test + */ + public function shouldFilterStills() + { + $this->setUp(); + + $stills = $this->images->filterStills(); + + foreach($stills as $still) { + $this->assertInstanceOf('Tmdb\Model\Image\StillImage', $still); + } + } + + /** + * @test + */ + public function shouldFilterMinHeight() + { + $this->setUp(); + + $images = $this->images->filterMinHeight(1000); + + $this->assertEquals(false, empty($images)); + + /** + * @var Image $image + */ + foreach($images as $image) { + $this->assertEquals(true, $image->getHeight() >= 1000); + } + } + + /** + * @test + */ + public function shouldFilterMinWidth() + { + $this->setUp(); + + $images = $this->images->filterMinWidth(1000); + + $this->assertEquals(false, empty($images)); + + /** + * @var Image $image + */ + foreach($images as $image) { + $this->assertEquals(true, $image->getWidth() >= 1000); + } + } + + /** + * @test + */ + public function shouldFilterMaxHeight() + { + $this->setUp(); + + $images = $this->images->filterMaxHeight(1000); + + $this->assertEquals(false, empty($images)); + + /** + * @var Image $image + */ + foreach($images as $image) { + $this->assertEquals(true, $image->getHeight() <= 1000); + } + } + + /** + * @test + */ + public function shouldFilterMaxWidth() + { + $this->setUp(); + + $images = $this->images->filterMaxWidth(1000); + + $this->assertEquals(false, empty($images)); + + /** + * @var Image $image + */ + foreach($images as $image) { + $this->assertEquals(true, $image->getWidth() <= 1000); + } + } + + /** + * @test + */ + public function shouldFilterBestImage() + { + $this->setUp(); + + $image = $this->images->filterBestVotedImage(); + + $this->assertInstanceOf('Tmdb\Model\Image', $image); + } + protected function getFactoryClass() { return 'Tmdb\Factory\ImageFactory'; diff --git a/test/Tmdb/Tests/Model/Collection/PeopleTest.php b/test/Tmdb/Tests/Model/Collection/PeopleTest.php index ad5a1686..3aa17116 100644 --- a/test/Tmdb/Tests/Model/Collection/PeopleTest.php +++ b/test/Tmdb/Tests/Model/Collection/PeopleTest.php @@ -32,8 +32,8 @@ public function setUp() { $this->collection = new People(); - foreach($this->people as $keyword) { - $object = $this->hydrate(new Person(), $keyword); + foreach($this->people as $person) { + $object = $this->hydrate(new Person(), $person); $this->collection->addPerson($object); } diff --git a/test/Tmdb/Tests/Resources/images/movie.json b/test/Tmdb/Tests/Resources/images/movie.json new file mode 100644 index 00000000..bc62eb9c --- /dev/null +++ b/test/Tmdb/Tests/Resources/images/movie.json @@ -0,0 +1,142 @@ +{ +"id": 550, +"backdrops": [ +{ +"file_path": "/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg", +"width": 1280, +"height": 720, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 6.6470588235294121, +"vote_count": 17 +}, +{ +"file_path": "/8T0hpqWsgzKhWGsXGD8ilkwRPkC.jpg", +"width": 1280, +"height": 720, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 6.375, +"vote_count": 12 +}, +{ +"file_path": "/hNFMawyNDWZKKHU4GYCBz1krsRM.jpg", +"width": 1280, +"height": 720, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 5.7142857142857144, +"vote_count": 14 +}, +{ +"file_path": "/mMZRKb3NVo5ZeSPEIaNW9buLWQ0.jpg", +"width": 1920, +"height": 1080, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 5.5625, +"vote_count": 8 +}, +{ +"file_path": "/9Kr6UzouF674Smw3D9Hp2DlH1Vo.jpg", +"width": 1280, +"height": 720, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 5.5499999999999998, +"vote_count": 10 +}, +{ +"file_path": "/eTVdpy2JXaGFit2V2ToZ79v9D7R.jpg", +"width": 1920, +"height": 1080, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 5.25, +"vote_count": 12 +}, +{ +"file_path": "/fuSeIUKsizmfiPIwDH7lKiFNQoD.jpg", +"width": 1280, +"height": 720, +"iso_639_1": null, +"aspect_ratio": 1.78, +"vote_average": 4.2999999999999998, +"vote_count": 5 +} +], +"posters": [ +{ +"file_path": "/2lECpi35Hnbpa4y46JX0aY3AWTy.jpg", +"width": 1000, +"height": 1500, +"iso_639_1": "en", +"aspect_ratio": 0.67000000000000004, +"vote_average": 6.1395348837209305, +"vote_count": 43 +}, +{ +"file_path": "/shFj1K58Tn55Qz2p2v0RqxXiXyo.jpg", +"width": 1000, +"height": 1408, +"iso_639_1": "en", +"aspect_ratio": 0.70999999999999996, +"vote_average": 6.0, +"vote_count": 2 +}, +{ +"file_path": "/jQ2iUsXI2jmUcOFGjOaONCLwaVp.jpg", +"width": 675, +"height": 1000, +"iso_639_1": "en", +"aspect_ratio": 0.68000000000000005, +"vote_average": 5.546875, +"vote_count": 32 +}, +{ +"file_path": "/6cMPLU1jv8pG9BMmieXCHDTVRPm.jpg", +"width": 1479, +"height": 2166, +"iso_639_1": "es", +"aspect_ratio": 0.68000000000000005, +"vote_average": 5.375, +"vote_count": 4 +}, +{ +"file_path": "/pKGrxTB35AkLsZCT8d8h6F9BSMN.jpg", +"width": 1000, +"height": 1500, +"iso_639_1": "en", +"aspect_ratio": 0.67000000000000004, +"vote_average": 5.3611111111111107, +"vote_count": 18 +}, +{ +"file_path": "/5qEBvDRdY2S2CJ9tsoFktIt8Xue.jpg", +"width": 2689, +"height": 3539, +"iso_639_1": "es", +"aspect_ratio": 0.76000000000000001, +"vote_average": 5.25, +"vote_count": 2 +}, +{ +"file_path": "/1dTxsr21UmFewu2CJ886JNqqkqn.jpg", +"width": 2030, +"height": 3000, +"iso_639_1": "en", +"aspect_ratio": 0.68000000000000005, +"vote_average": 5.25, +"vote_count": 6 +}, +{ +"file_path": "/olTEZdZJ7UKLE1o4hkFDq4jXBs8.jpg", +"width": 713, +"height": 1002, +"iso_639_1": "hu", +"aspect_ratio": 0.70999999999999996, +"vote_average": 5.25, +"vote_count": 2 +} +] +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/images/person.json b/test/Tmdb/Tests/Resources/images/person.json new file mode 100644 index 00000000..a13e3718 --- /dev/null +++ b/test/Tmdb/Tests/Resources/images/person.json @@ -0,0 +1,26 @@ +{ + "id": 287, + "profiles": [ + { + "file_path": "/w8zJQuN7tzlm6FY9mfGKihxp3Cb.jpg", + "width": 1295, + "height": 1969, + "iso_639_1": null, + "aspect_ratio": 0.66000000000000003 + }, + { + "file_path": "/cLUacutO7dOMksQK8Zg0q2Gybsx.jpg", + "width": 820, + "height": 1230, + "iso_639_1": null, + "aspect_ratio": 0.67000000000000004 + }, + { + "file_path": "/zEbgoayf0MfuSznehhXdaP2YkeH.jpg", + "width": 700, + "height": 983, + "iso_639_1": null, + "aspect_ratio": 0.70999999999999996 + } + ] +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/images/tv.json b/test/Tmdb/Tests/Resources/images/tv.json new file mode 100644 index 00000000..ef1e3d0e --- /dev/null +++ b/test/Tmdb/Tests/Resources/images/tv.json @@ -0,0 +1,835 @@ +{ + "backdrops": [ + { + "aspect_ratio": 1.78, + "file_path": "/dRaV8HGx7Z9xmw77qSs8prp5OuI.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/mojM8NJQlpTWpiD68rcOWnzcEVR.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/nIh1ygw5kVRaEFqXcj8CTi3pKK5.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bbFaLaLv8TwR7KKnZ3reHGS4VQO.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bFWW5vVZS1YW0a0Cq0liYakj6vt.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/siv4GtEMtrqljl0qiTGCvzolXWH.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/wvFckSZAG1OVPEwM8YUtLC3DOWk.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/162VmHV23N1FqQhYjZiZCH9GkQA.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/yG8QDHyrVMBe5H7Q7cIPKq45Iq0.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/gzqjlgcYIHZSnUS1bnxVDxQwCR0.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/eIOpMbnMqiAgBS8cZocAATRsb28.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/9V1yohvMOePVd6b1WiUItPEN8sK.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bzoZjhbpriBT2N5kwgK0weUfVOX.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/n5kIjzyYNdDfJbfNkG68j3qDm6n.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/qfWveejMEeA4zGgscX8YUUTLuTB.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/6tRuCy7VXidZVRXIR4ThBx2omK3.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/3FnSPz1nqkaW65dj4BWRN185adp.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/va7jNaQUsIdWADokQSdPXeJYk1O.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/nXlTbIrgroOCCKQSsMizmqQ4NAG.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bZ23G5JiNmeZG9t6hRMLhY9W3gP.jpg", + "height": 720.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1280.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/eSzpy96DwBujGFj0xMbXBcGcfxX.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/mrPw1gAXXV8OYQTr8ipKuYTuaa6.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/gVqPqjyiDmpoNJOFjvg0b8WCC3R.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bagJdiz7JzB1bb87x24qKwrgWwK.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/an69IYogpnY2spo1dGVjmTy0m49.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/eCaT3wx244KPmnMchvag3kSGGw5.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/u3TcKJ1qqgd8D3Dd73FnIMVVsur.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/yFVUqiugxQLLrYxwsIcGQ3P8FWO.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/qamG9LeH42UombW1bfZlIlzO5Y1.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/6u4YG0oNzhFaFJs080ljlpSgpfD.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/ewRICWQvNXsViiUouM3M3jm5VyI.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/qgSmYpFBZdfHbjssjJN1XOrb2Us.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/tJAeZ3OoWDC1LVe7IBmGnBSOYZX.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/zzSjSRC04z7dc4xQopWTJYmXb9g.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/vIgu5fsJH50QcSz2hmfaqJHovUo.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/upeNbWF5wKZUOUcUW4EnVfYYjRo.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/oyOGhA8G74rd8c6VdeU3Mi7v8n7.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/2X0RK6uztO7J5XBSRtRcNGlzGml.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/gN14vIo5T2G3kwtdS1lHuFeJXJ9.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/2cxsSpTNb8SFczKLrnXlhw2p7hW.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/yjcJtXWrQfU96l3b46iMvNNpg3Z.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/5sHew9rjOsALuDVxwu0pJexOXWA.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/61nBiocMvOxvPtJgxk3GLCePvcf.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/aIOpF9Fp1SbYpSusJ3scDTYrqod.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/bTJLGUbqcGAuZnNvp59zjqqLzOR.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/y3Roit8o1v7EYXGqH7AQMNUBZQR.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/mpfWjvSmNaYCzfUmfnGe1A1wkbu.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/77q8qOwsEJyZGDf3nzhq13bg98X.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/zintOUBVjVapaNN3vAmm1rcfY1p.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/rmOmfel02YAgVRUdb9tlRyLW8mm.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/23RzDwwd78gCffMoBXoOKKSRlcr.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/m5apfrjjgc7jbOwRTXqDF5EXXfO.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/nxVC9a6TjeoKr6Ezkfz1jRSlf6L.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/qnnW0CY89lQZPgNrwpARJOBQtI1.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/k2N2DpK7kDcM0rXLKuTV6bUTIZN.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/ebQo1jOfx9UR9cPzBa6bHpxMWhq.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/rMvlRVBngldwWCoGqxQoPdJRnwC.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/abFs25RWEvn8WkLholkqFAUC8OF.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/lPQn4F48YL5IwwrjPx6QRRuDyjR.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/v5F4chUYiRnH9cI2JCpWrrK3q6D.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/ymrPqhHl8v9tf3eK3f9byggZ0n7.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + }, + { + "aspect_ratio": 1.78, + "file_path": "/99PL1OnOT9PVZx09qerR0s1g0Gx.jpg", + "height": 1080.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 1920.0 + } + ], + "id": 1396, + "posters": [ + { + "aspect_ratio": 0.68, + "file_path": "/iRDNn9EHKuBhGa77UBteazvsZa1.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 5.29761904761905, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/51H0ifZ0TM5sAp4yBvolUpFaPaC.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/xkbl9GV6p9JwDPXIYwODVcunlRT.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/u69b0G6HlfrwkchQdn8lzEEjFxt.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/8VxH7FSiCDmSZyfxsqz25ZWbP7O.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/hyWz3p2KCxw3T3OTyFzQgYvkhJf.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/7pFpIXpn2DOst3bOMQIqCEHeAWS.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/mmtUaqRpsWcqb4ISF3CaoK0ptO7.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/i5bfplXbyLm7BvofUBVj7Zaan4w.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/mVIvcV9IEsfnTdbNXPNWkiU6N7t.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/e6Ydx9xHuiQa6qsx20LR4x71DCS.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/3bHLOzAOY2Rn4c5YrvALzZVE6tg.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/t9r2UYuRppdZKmeYHSgdx09uHzl.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/3feoWsQPtBdUhrOCVPB1iazSb2W.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/fO3OqQQEIZN44K9jcs0Q4JuFHOl.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/uL7s6lRsApvFuxQFqT5FA1SuSdX.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/6uiT7QidRjVVywFgOAUQoY7iPup.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/1gNZDkSc1kb9azLYVQHS9DCBpAs.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/zdipQZmcmaCUNGsXP6OdBEjDCSP.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/xd8tk9ox8QvQClvD48bmQc2t6dx.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/pOLOC2tzz70N1RngVZtfhJuB5Fp.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/85fOzuORUuQlDPSNkFCDnaUXZtv.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/21YJ4mM7C9V5e2esqeB4AoBjKPy.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/xMvrBjxu2EskHhiZ2sNgufBhGzF.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/wnoMOVO06oI55fWrR0mQUbquERh.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/nXXSNb8qXn66DeZL0BIG79Omyo2.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/biPjf15logCBAIptiM1YYCOeTxE.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/ccxTzJHWYhAGg3MFaTzGfpFAXGi.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/oAJvOW85rXKs8GlWoT5jssd7qNU.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + }, + { + "aspect_ratio": 0.68, + "file_path": "/fzNaunYfNFvVesiIvcEgr8h4qix.jpg", + "height": 1000.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 680.0 + } + ] +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/images/tv_episode.json b/test/Tmdb/Tests/Resources/images/tv_episode.json new file mode 100644 index 00000000..b275977a --- /dev/null +++ b/test/Tmdb/Tests/Resources/images/tv_episode.json @@ -0,0 +1,14 @@ +{ + "id": 62085, + "stills": [ + { + "aspect_ratio": 1.48, + "file_path": "/2IksiG9RPQ4lxYxgiKEhns0N4Zx.jpg", + "height": 271.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + } + ] +} \ No newline at end of file diff --git a/test/Tmdb/Tests/Resources/images/tv_season.json b/test/Tmdb/Tests/Resources/images/tv_season.json new file mode 100644 index 00000000..a10482d1 --- /dev/null +++ b/test/Tmdb/Tests/Resources/images/tv_season.json @@ -0,0 +1,131 @@ +{ + "id": 3572, + "posters": [ + { + "aspect_ratio": 0.69, + "file_path": "/6lP6ac4wNmWgtfVvrsl53bMqrKS.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/wr0pPDfwn4gNQxjNWpkazhN13tZ.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/zPrE7NvhW6kk9acm8yXjdgDcXZJ.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/8yHDd0EVpNpWk1VBa9QP4iUmw0v.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/zJV0m4IFtsmF2QsCk4Yrwv5frNn.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/z6eMdUp2mF2rsmOnZH2N0S9QGFY.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/tFnhmMscpXZxiceNOSC6ooxtn51.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/spPmYZAq2xLKQOEIdBPkhiRxrb9.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/ryreluyqCf6CxlEFbZSceVGw8NL.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/m8V6Fm2dV7tNvjCmBpROSU3Zrq4.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/oW0G4MKWcyNaRGckZf8WRFyO5cH.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/tkZ9bXm9iFNEdZmblSl8rxgpstT.jpg", + "height": 578.0, + "iso_639_1": null, + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/l5s5lfqpdP4uigrZtu5Sg8hfWqG.jpg", + "height": 578.0, + "iso_639_1": "en", + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + }, + { + "aspect_ratio": 0.69, + "file_path": "/2lhO5zd1nnf7PjC7dGCUo45Volz.jpg", + "height": 578.0, + "iso_639_1": "en", + "vote_average": 0.0, + "vote_count": 0, + "width": 400.0 + } + ] +} \ No newline at end of file