Fix errors in PHP <5.4

This commit is contained in:
mark_story 2015-09-06 22:14:04 -04:00
parent 60d7bbaa10
commit e4cce7a441

View file

@ -396,7 +396,9 @@ class ModelWriteTest extends BaseModelTest {
public function testSaveUpdatedWithFieldList() { public function testSaveUpdatedWithFieldList() {
$this->loadFixtures('Post', 'Author'); $this->loadFixtures('Post', 'Author');
$model = ClassRegistry::init('Post'); $model = ClassRegistry::init('Post');
$original = $model->find('first', ['conditions' => ['Post.id' => 1]]); $original = $model->find('first', array(
'conditions' => array('Post.id' => 1)
));
$data = array( $data = array(
'Post' => array( 'Post' => array(
'id' => 1, 'id' => 1,
@ -405,9 +407,11 @@ class ModelWriteTest extends BaseModelTest {
) )
); );
$model->save($data, array( $model->save($data, array(
'fieldList' => ['title'] 'fieldList' => array('title')
));
$new = $model->find('first', array(
'conditions' => array('Post.id' => 1)
)); ));
$new = $model->find('first', ['conditions' => ['Post.id' => 1]]);
$this->assertGreaterThan($original['Post']['updated'], $new['Post']['updated']); $this->assertGreaterThan($original['Post']['updated'], $new['Post']['updated']);
} }