4 * Class CRM_Utils_SQL_SelectTest
7 class CRM_Utils_SQL_InsertTest
extends CiviUnitTestCase
{
9 public function testRow_twice() {
10 $insert = CRM_Utils_SQL_Insert
::into('foo')
11 ->row(['first' => '1', 'second' => '2'])
12 ->row(['second' => '2b', 'first' => '1b']);
14 INSERT INTO foo (`first`,`second`) VALUES
18 $this->assertLike($expected, $insert->toSQL());
21 public function testRows() {
22 $insert = CRM_Utils_SQL_Insert
::into('foo')
23 ->row(['first' => '1', 'second' => '2'])
25 ['second' => '2b', 'first' => '1b'],
26 ['first' => '1c', 'second' => '2c'],
28 ->row(['second' => '2d', 'first' => '1d'])
29 ->row(['first' => NULL, 'second' => '2e']);
31 INSERT INTO foo (`first`,`second`) VALUES
38 $this->assertLike($expected, $insert->toSQL());