From e3137c70a43bf44445f0276c39fcf987fe0f85e1 Mon Sep 17 00:00:00 2001 From: pookey Date: Mon, 16 Oct 2006 16:17:07 +0000 Subject: [PATCH] pookey: error with copy, refs #172 --- tests/RecordTestCase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/RecordTestCase.php b/tests/RecordTestCase.php index 72a34ed68..07dc1e715 100644 --- a/tests/RecordTestCase.php +++ b/tests/RecordTestCase.php @@ -644,11 +644,19 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase { $this->assertEqual($user->getModified(), array()); $this->assertEqual($user->name, "Jack Daniels"); } + public function testCopy() { $user = $this->connection->getTable("User")->find(4); $new = $user->copy(); + $this->assertTrue($new instanceof Doctrine_Record); $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() {