Skip to content

Commit

Permalink
Add tests for Model::clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 14, 2013
1 parent b2a40c7 commit 1c358c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Cake/Test/Case/Model/ModelWriteTest.php
Expand Up @@ -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']));
}
}

0 comments on commit 1c358c0

Please sign in to comment.