1
0
mirror of synced 2025-01-06 00:57:10 +03:00

pookey: error with copy, refs #172

This commit is contained in:
pookey 2006-10-16 16:17:07 +00:00
parent e32e960b1d
commit e3137c70a4

View File

@ -644,11 +644,19 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this->assertEqual($user->getModified(), array()); $this->assertEqual($user->getModified(), array());
$this->assertEqual($user->name, "Jack Daniels"); $this->assertEqual($user->name, "Jack Daniels");
} }
public function testCopy() { public function testCopy() {
$user = $this->connection->getTable("User")->find(4); $user = $this->connection->getTable("User")->find(4);
$new = $user->copy(); $new = $user->copy();
$this->assertTrue($new instanceof Doctrine_Record); $this->assertTrue($new instanceof Doctrine_Record);
$this->assertTrue($new->getState() == Doctrine_Record::STATE_TDIRTY); $this->assertTrue($new->getState() == Doctrine_Record::STATE_TDIRTY);
$new->save();
$this->assertTrue(is_numeric($new->id) && $new->id > 0);
$new->refresh();
$this->assertEqual($user->name, $new->name);
} }
public function testReferences() { public function testReferences() {