/**
  * @test
  */
 public function shouldCreateValidQuery()
 {
     $query = new DiscoverTvQuery();
     $now = new \DateTime();
     $query->page(1)->language('en')->sortBy('sort')->firstAirDateYear($now)->voteCountGte(5)->voteAverageGte(3)->withGenres([15, 18])->withGenresOr([1, 2])->withGenresAnd([18])->firstAirDateGte($now)->firstAirDateLte($now)->withNetworks([1, 2])->withNetworksAnd([1, 2, 3]);
     $this->assertEquals(10, count($query));
 }
Ejemplo n.º 2
0
 /**
  * Discover TV shows by different types of data like average rating,
  * number of votes, genres, the network they aired on and air dates.
  *
  * @param  DiscoverTvQuery                      $query
  * @param  array                                $headers
  * @return Tv[]
  * @return \Tmdb\Model\Common\GenericCollection
  */
 public function discoverTv(DiscoverTvQuery $query, array $headers = array())
 {
     $data = $this->getApi()->discoverTv($query->toArray(), $headers);
     return $this->getTvFactory()->createResultCollection($data);
 }