Files
yii2/tests/framework/db/testBatchInsertWithYield.php
2022-08-03 12:32:18 +03:00

23 lines
477 B
PHP

<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/* @var $this \yiiunit\framework\db\CommandTest */
$rows = call_user_func(function () {
if (false) {
yield [];
}
});
$command = $this->getConnection()->createCommand();
$command->batchInsert(
'{{customer}}',
['email', 'name', 'address'],
$rows
);
$this->assertEquals(0, $command->execute());