mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Add tests for Model::clear()
This commit is contained in:
parent
b2a40c787d
commit
1c358c0f53
1 changed files with 15 additions and 0 deletions
|
@ -7078,4 +7078,19 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
'conditions' => array('Item.id' => 1)));
|
'conditions' => array('Item.id' => 1)));
|
||||||
$this->assertEquals(true, $result['Item']['published']);
|
$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']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue