mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding missing test from last commit.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8162 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
975ddaa4be
commit
f25cf63206
1 changed files with 31 additions and 0 deletions
|
@ -362,5 +362,36 @@ class DboMssqlTest extends CakeTestCase {
|
|||
$result = $this->db->getPrimaryKey($this->model);
|
||||
$this->assertNull($result);
|
||||
}
|
||||
/**
|
||||
* testInsertMulti
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testInsertMulti() {
|
||||
$fields = array('id', 'name', 'login');
|
||||
$values = array('(1, \'Larry\', \'PhpNut\')', '(2, \'Renan\', \'renan.saddam\')');
|
||||
$this->db->simulated = array();
|
||||
$this->db->insertMulti($this->model, $fields, $values);
|
||||
$result = $this->db->simulated;
|
||||
$expected = array(
|
||||
'SET IDENTITY_INSERT [mssql_test_models] ON',
|
||||
'INSERT INTO [mssql_test_models] ([id], [name], [login]) VALUES (1, \'Larry\', \'PhpNut\')',
|
||||
'INSERT INTO [mssql_test_models] ([id], [name], [login]) VALUES (2, \'Renan\', \'renan.saddam\')',
|
||||
'SET IDENTITY_INSERT [mssql_test_models] OFF'
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$fields = array('name', 'login');
|
||||
$values = array('(\'Larry\', \'PhpNut\')', '(\'Renan\', \'renan.saddam\')');
|
||||
$this->db->simulated = array();
|
||||
$this->db->insertMulti($this->model, $fields, $values);
|
||||
$result = $this->db->simulated;
|
||||
$expected = array(
|
||||
'INSERT INTO [mssql_test_models] ([name], [login]) VALUES (\'Larry\', \'PhpNut\')',
|
||||
'INSERT INTO [mssql_test_models] ([name], [login]) VALUES (\'Renan\', \'renan.saddam\')'
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue