Skip to content

Commit

Permalink
Downsizing Translation
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 5, 2014
1 parent f6d18bc commit e9254ff
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 40 deletions.
41 changes: 1 addition & 40 deletions lib/Tmdb/Model/Common/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
*/
namespace Tmdb\Model\Common;

use Tmdb\Model\AbstractModel;
use Tmdb\Model\Filter\LanguageFilter;

class Translation extends AbstractModel implements LanguageFilter {
class Translation extends SpokenLanguage implements LanguageFilter {

private $iso6391;
private $name;
private $englishName;

public static $_properties = array(
Expand All @@ -44,40 +41,4 @@ public function getEnglishName()
{
return $this->englishName;
}

/**
* @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
return $this;
}

/**
* @return string
*/
public function getIso6391()
{
return $this->iso6391;
}

/**
* @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}

/**
* @return string
*/
public function getName()
{
return $this->name;
}
}
44 changes: 44 additions & 0 deletions test/Tmdb/Tests/Model/Common/TranslationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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\Model\Common;

use Tmdb\Common\ObjectHydrator;
use Tmdb\Model\Common\Translation;
use Tmdb\Tests\Model\TestCase;

class TranslationTest extends TestCase
{
/**
* @test
* @todo fix
*/
public function shouldBeFunctional()
{
$data = array(
'iso_639_1' => 'en',
'name' => 'English',
'english_name' => 'English'
);

$hydrator = new ObjectHydrator();

$object = $hydrator->hydrate(new Translation(), $data);

/**
* @var Translation $object
*/
$this->assertEquals('en', $object->getIso6391());
$this->assertEquals('English', $object->getName());
$this->assertEquals('English', $object->getEnglishName());
}
}

0 comments on commit e9254ff

Please sign in to comment.