adding new enum tests ( refs #170 )
This commit is contained in:
parent
a04f118593
commit
edaf23df2d
@ -12,15 +12,52 @@ class Doctrine_EnumTestCase extends Doctrine_UnitTestCase {
|
|||||||
$this->assertEqual($test->status, 'open');
|
$this->assertEqual($test->status, 'open');
|
||||||
$test->save();
|
$test->save();
|
||||||
|
|
||||||
$query = new Doctrine_Query($this->connection);
|
try {
|
||||||
$ret = $query->query('FROM EnumTest WHERE EnumTest.status = ?', array('open'));
|
$query = new Doctrine_Query($this->connection);
|
||||||
$this->assertEqual(count($ret), 1);
|
$ret = $query->query('FROM EnumTest WHERE EnumTest.status = ?', array('open'));
|
||||||
|
$this->assertEqual(count($ret), 1);
|
||||||
$query = new Doctrine_Query($this->connection);
|
} catch (Exception $e) {
|
||||||
$ret = $query->query('FROM EnumTest WHERE EnumTest.status = open');
|
$this->fail();
|
||||||
$this->assertEqual(count($ret), 1);
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$query = new Doctrine_Query($this->connection);
|
||||||
|
$ret = $query->query('FROM EnumTest WHERE EnumTest.status = open');
|
||||||
|
$this->assertEqual(count($ret), 1);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->fail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInAndNotIn() {
|
||||||
|
try {
|
||||||
|
$query = new Doctrine_Query($this->connection);
|
||||||
|
$ret = $query->query('FROM EnumTest WHERE EnumTest.status IN (open)');
|
||||||
|
$this->assertEqual(count($ret), 1);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$query = new Doctrine_Query($this->connection);
|
||||||
|
$ret = $query->query('FROM EnumTest WHERE EnumTest.status NOT IN (verified, closed)');
|
||||||
|
$this->assertEqual(count($ret), 1);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testNotEqual()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$query = new Doctrine_Query($this->connection);
|
||||||
|
$ret = $query->query('FROM EnumTest WHERE EnumTest.status != closed');
|
||||||
|
$this->assertEqual(count($ret), 1);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function testEnumType() {
|
public function testEnumType() {
|
||||||
|
|
||||||
$enum = new EnumTest();
|
$enum = new EnumTest();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user