Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for Model::clear()

  • Loading branch information...
commit 1c358c0f537bd8320fdf860c2aa169f929ac2d04 1 parent b2a40c7
@markstory markstory authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Cake/Test/Case/Model/ModelWriteTest.php
View
15 lib/Cake/Test/Case/Model/ModelWriteTest.php
@@ -7078,4 +7078,19 @@ public function testUpdateBoolean() {
'conditions' => array('Item.id' => 1)));
$this->assertEquals(true, $result['Item']['published']);
}
+
+/**
+ * Test the clear() method.
+ *
+ * @return void
+ */
+ public function testClear() {
+ $this->loadFixtures('Bid');
+ $model = ClassRegistry::init('Bid');
+ $model->set(array('name' => 'Testing', 'message_id' => 3));
+ $this->assertTrue(isset($model->data['Bid']['name']));
+ $this->assertTrue($model->clear());
+ $this->assertFalse(isset($model->data['Bid']['name']));
+ $this->assertFalse(isset($model->data['Bid']['message_id']));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.