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
04dc350
commit ad9408b
Showing
26 changed files
with
586 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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,62 @@ | ||
<?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\Factory; | ||
|
||
use Tmdb\Factory\CollectionFactory; | ||
use Tmdb\Model\Collection; | ||
|
||
class CollectionFactoryTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function shouldConstructCollection() | ||
{ | ||
/** | ||
* @var CollectionFactory $factory | ||
*/ | ||
$factory = $this->getFactory(); | ||
$data = $this->loadByFile('collection/get.json'); | ||
|
||
/** | ||
* @var Collection $collection | ||
*/ | ||
$collection = $factory->create($data); | ||
|
||
$this->assertInstanceOf('Tmdb\Model\Collection', $collection); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldBeAbleToSetFactories() | ||
{ | ||
/** | ||
* @var CollectionFactory $factory | ||
*/ | ||
$factory = $this->getFactory(); | ||
|
||
$class = new \stdClass(); | ||
|
||
$factory->setMovieFactory($class); | ||
$factory->setImageFactory($class); | ||
|
||
$this->assertInstanceOf('stdClass', $factory->getMovieFactory()); | ||
$this->assertInstanceOf('stdClass', $factory->getImageFactory()); | ||
} | ||
|
||
protected function getFactoryClass() | ||
{ | ||
return 'Tmdb\Factory\CollectionFactory'; | ||
} | ||
} |
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,62 @@ | ||
<?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\Factory; | ||
|
||
use Tmdb\Factory\ConfigurationFactory; | ||
use Tmdb\Model\Configuration; | ||
|
||
class ConfigurationFactoryTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function shouldConstructConfiguration() | ||
{ | ||
/** | ||
* @var ConfigurationFactory $factory | ||
*/ | ||
$factory = $this->getFactory(); | ||
$data = $this->loadByFile('configuration/get.json'); | ||
|
||
/** | ||
* @var Configuration $configuration | ||
*/ | ||
$configuration = $factory->create($data); | ||
|
||
$this->assertInstanceOf('Tmdb\Model\Configuration', $configuration); | ||
|
||
$images = $configuration->getImages(); | ||
$changeKeys = $configuration->getChangeKeys(); | ||
|
||
$this->assertEquals(true, !empty($images)); | ||
$this->assertEquals(true, !empty($changeKeys)); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function callingCollectionReturnsEmptyArray() | ||
{ | ||
/** | ||
* @var ConfigurationFactory $factory | ||
*/ | ||
$factory = $this->getFactory(); | ||
|
||
$this->assertEquals(array(), $factory->createCollection(array())); | ||
} | ||
|
||
protected function getFactoryClass() | ||
{ | ||
return 'Tmdb\Factory\ConfigurationFactory'; | ||
} | ||
} |
Oops, something went wrong.