Files
yii2/tests/framework/db/testBatchInsertWithYield.php

19 lines
333 B
PHP

<?php
/**
* @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());