Commit edaf23df authored by pookey's avatar pookey

adding new enum tests ( refs #170 )

parent a04f1185
...@@ -12,15 +12,52 @@ class Doctrine_EnumTestCase extends Doctrine_UnitTestCase { ...@@ -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);
} catch (Exception $e) {
$this->fail();
}
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();
}
}
$query = new Doctrine_Query($this->connection); public function testInAndNotIn() {
$ret = $query->query('FROM EnumTest WHERE EnumTest.status = open'); try {
$this->assertEqual(count($ret), 1); $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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment