1
0
mirror of synced 2025-01-18 06:21:40 +03:00

adding new enum tests ( refs #170 )

This commit is contained in:
pookey 2006-10-15 22:50:46 +00:00
parent a04f118593
commit edaf23df2d

View File

@ -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();