mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
adding test to model, closes #4809
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7076 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
39feb3f7c1
commit
73e926fea8
1 changed files with 21 additions and 0 deletions
|
@ -4163,6 +4163,27 @@ class ModelTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testSaveDateAsFirstEntry() {
|
||||
$this->loadFixtures('Article');
|
||||
|
||||
$Article =& new Article();
|
||||
|
||||
$data = array('Article' => array(
|
||||
'created' => array(
|
||||
'day' => '1', 'month' => '1', 'year' => '2008'
|
||||
),
|
||||
'title' => 'Test Title',
|
||||
));
|
||||
$Article->create();
|
||||
$this->assertTrue($Article->save($data));
|
||||
|
||||
$testResult = $Article->find(array('Article.title' => 'Test Title'));
|
||||
|
||||
$this->assertEqual($testResult['Article']['title'], $data['Article']['title']);
|
||||
$this->assertEqual($testResult['Article']['created'], '2008-01-01 00:00:00');
|
||||
|
||||
}
|
||||
|
||||
|
||||
function endTest() {
|
||||
|
|
Loading…
Add table
Reference in a new issue