Skip to content

Instantly share code, notes, and snippets.

@ptica
Created August 22, 2012 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptica/3424300 to your computer and use it in GitHub Desktop.
Save ptica/3424300 to your computer and use it in GitHub Desktop.
cakephp 2.2.1 Model::save doubles all numeric arrays
function testDoubleSave() {
$to_save = array(
'Article' => array(
'title' => 'title',
'body' => 'body',
),
'Meta' => array(10, 12),
);
$result = $this->Article->save($to_save);
$expected = $to_save;
$this->assertEquals($expected['Meta'], $result['Meta']);
}
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
0 => 10
1 => 12
+ 2 => 10
+ 3 => 12
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment