Files
Phraseanet/lib/unitTest/Setup/Setup_ConstraintTest.php
2012-01-11 20:04:47 +01:00

49 lines
1.3 KiB
PHP

<?php
require_once __DIR__ . '/../PhraseanetPHPUnitAbstract.class.inc';
/**
* Test class for Setup_Constraint.
* Generated by PHPUnit on 2011-10-27 at 18:08:06.
*/
class Setup_ConstraintTest extends PhraseanetPHPUnitAbstract
{
protected $object_non_blocker;
protected $object_blocker;
protected $message = "&é'(§è!çà dfljk sdq'";
protected $name = "Un joli nom";
public function setUp()
{
$this->object_non_blocker = new Setup_Constraint($this->name, true, $this->message, false);
$this->object_blocker = new Setup_Constraint($this->name, false, $this->message, true);
}
public function testGet_name()
{
$this->assertEquals($this->name, $this->object_blocker->get_name());
$this->assertEquals($this->name, $this->object_non_blocker->get_name());
}
public function testIs_ok()
{
$this->assertFalse($this->object_blocker->is_ok());
$this->assertTrue($this->object_non_blocker->is_ok());
}
public function testIs_blocker()
{
$this->assertTrue($this->object_blocker->is_blocker());
$this->assertFalse($this->object_non_blocker->is_blocker());
}
public function testGet_message()
{
$this->assertEquals($this->message, $this->object_blocker->get_message());
$this->assertEquals($this->message, $this->object_non_blocker->get_message());
}
}