forked from php-tmdb/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56c161e
commit 4c1f1b6
Showing
2 changed files
with
149 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?php | ||
/** | ||
* This file is part of the Tmdb PHP API created by Michael Roterman. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @package Tmdb | ||
* @author Michael Roterman <[email protected]> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Tests\Repository; | ||
|
||
use Tmdb\Model\Search\SearchQuery\CollectionSearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\CompanySearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\KeywordSearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\ListSearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\MovieSearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\PersonSearchQuery; | ||
use Tmdb\Model\Search\SearchQuery\TvSearchQuery; | ||
use Tmdb\Repository\SearchRepository; | ||
|
||
class SearchRepositoryTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchMovie() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchMovie('rush hour', new MovieSearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchCollection() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchCollection('the matrix', new CollectionSearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchTv() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchTv('breaking bad', new TvSearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchPerson() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchPerson('johnny knoxville', new PersonSearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchList() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchList('golden', new ListSearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchCompany() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchCompany('disney', new CompanySearchQuery()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldSearchKeyword() | ||
{ | ||
/** | ||
* @var SearchRepository $repository | ||
*/ | ||
$repository = $this->getRepositoryWithMockedHttpClient(); | ||
|
||
$repository->searchKeyword('alien', new KeywordSearchQuery()); | ||
} | ||
|
||
protected function getApiClass() | ||
{ | ||
return 'Tmdb\Api\Search'; | ||
} | ||
|
||
protected function getRepositoryClass() | ||
{ | ||
return 'Tmdb\Repository\SearchRepository'; | ||
} | ||
} |