mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix errors in PHP <5.4
This commit is contained in:
parent
60d7bbaa10
commit
e4cce7a441
1 changed files with 7 additions and 3 deletions
|
@ -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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue