Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Restructuring Strings test so that it is compatible with this change

  • Loading branch information...
commit 9d7148e16f314032f55704255da6e926ee792fc9 1 parent 12a142d
@cincodenada cincodenada authored
Showing with 23 additions and 1 deletion.
  1. +23 −1 lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
View
24 lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
@@ -436,6 +436,10 @@ public function insertCallback($table, $fields, $values) {
$this->insertMulti['table'] = $table;
$this->insertMulti['fields'] = $fields;
$this->insertMulti['values'] = $values;
+ $this->insertMulti['fields_values'] = array();
+ foreach($values as $record) {
+ $this->insertMulti['fields_values'][] = array_combine($fields, $record);
+ }
return true;
}
@@ -454,13 +458,31 @@ public function testInsertStrings() {
$this->assertTrue($this->criticDb->fullDebug);
$this->assertTrue($return);
$this->assertEquals('strings', $this->insertMulti['table']);
- $this->assertEquals(array('email', 'name', 'age'), $this->insertMulti['fields']);
+ $this->assertEquals(array('name', 'email', 'age'), array_values($this->insertMulti['fields']));
$expected = array(
array('Mark Doe', 'mark.doe@email.com', null),
array('John Doe', 'john.doe@email.com', 20),
array('Jane Doe', 'jane.doe@email.com', 30),
);
$this->assertEquals($expected, $this->insertMulti['values']);
+ $expected = array(
+ array(
+ 'name' => 'Mark Doe',
+ 'email' => 'mark.doe@email.com',
+ 'age' => null
+ ),
+ array(
+ 'name' => 'John Doe',
+ 'email' => 'john.doe@email.com',
+ 'age' => 20
+ ),
+ array(
+ 'name' => 'Jane Doe',
+ 'email' => 'jane.doe@email.com',
+ 'age' => 30
+ ),
+ );
+ $this->assertEquals($expected, $this->insertMulti['fields_values']);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.