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:
gwoo 2008-05-31 16:57:30 +00:00
parent 39feb3f7c1
commit 73e926fea8

View file

@ -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() {