1
0
mirror of synced 2025-01-17 22:11:41 +03:00

modified testcase so that it fails with validators

This commit is contained in:
meus 2007-08-06 20:17:00 +00:00
parent 94c7b9f6ef
commit 14ec057104

View File

@ -83,16 +83,22 @@ class Doctrine_Record_Hook_TestCase extends Doctrine_UnitTestCase
{
$r = new SoftDeleteTest();
$r->name = 'something';
$r->something ='something';
$r->save();
$this->assertEqual($r->name, 'something');
$this->assertEqual($r->something, 'something');
$this->assertEqual($r->deleted, null);
$this->assertEqual($r->getState(), Doctrine_Record::STATE_CLEAN);
$r->delete();
$this->assertEqual($r->getState(), Doctrine_Record::STATE_CLEAN);
$this->assertEqual($r->deleted, true);
try{
$r->delete();
$this->assertEqual($r->getState(), Doctrine_Record::STATE_CLEAN);
$this->assertEqual($r->deleted, true);
}catch(Doctrine_Exception $e){
$this->fail();
}
}
}
class SoftDeleteTest extends Doctrine_Record
@ -100,6 +106,7 @@ class SoftDeleteTest extends Doctrine_Record
public function setTableDefinition()
{
$this->hasColumn('name', 'string', null, array('primary' => true));
$this->hasColumn('something', 'string', '25', array('notnull' => true, 'unique' => true));
$this->hasColumn('deleted', 'boolean', 1);
}
public function preDelete($event)