Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Vocabulary/TermTest.php
2013-01-18 17:47:25 +01:00

71 lines
2.0 KiB
PHP

<?php
namespace Alchemy\Tests\Phrasea\Vocabulary;
use Alchemy\Phrasea\Vocabulary\Term;
use Alchemy\Phrasea\Vocabulary\ControlProvider\UserProvider;
class TermTest extends \PhraseanetPHPUnitAbstract
{
/**
* @var Term
*/
protected $object;
/**
* @var Term
*/
protected $basicObject;
/**
* @var Term
*/
protected $objectWithControl;
protected $value2 = 'Supa valu&é"\'(§è!)';
protected $context2 = 'context
oualibi';
protected $basicValue = 'Joli chien';
protected $value = 'One value';
protected $context = 'Another context';
protected $control;
protected $id = 25;
public function setUp()
{
parent::setUp();
$this->control = new UserProvider(self::$DI['app']);
$this->object = new Term($this->value, $this->context);
$this->basicObject = new Term($this->basicValue);
$this->objectWithControl = new Term($this->value2, $this->context2, $this->control, $this->id);
}
public function testGetValue()
{
$this->assertEquals($this->basicValue, $this->basicObject->getValue());
$this->assertEquals($this->value, $this->object->getValue());
$this->assertEquals($this->value2, $this->objectWithControl->getValue());
}
public function testGetContext()
{
$this->assertEquals(null, $this->basicObject->getContext());
$this->assertEquals($this->context, $this->object->getContext());
$this->assertEquals($this->context2, $this->objectWithControl->getContext());
}
public function testGetType()
{
$this->assertEquals(null, $this->basicObject->getType());
$this->assertEquals(null, $this->object->getType());
$this->assertEquals($this->control, $this->objectWithControl->getType());
}
public function testGetId()
{
$this->assertEquals(null, $this->basicObject->getId());
$this->assertEquals(null, $this->object->getId());
$this->assertEquals($this->id, $this->objectWithControl->getId());
}
}