mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/11469] Do not repeat array with three rows.
PHPBB3-11469
This commit is contained in:
@@ -129,23 +129,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
|
||||
|
||||
$this->assert_config_count($db, 2);
|
||||
|
||||
$this->assertTrue($buffer->insert_all(array(
|
||||
array(
|
||||
'config_name' => 'name1',
|
||||
'config_value' => 'value1',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name2',
|
||||
'config_value' => 'value2',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name3',
|
||||
'config_value' => 'value3',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
)));
|
||||
$this->assertTrue($buffer->insert_all($this->get_three_rows()));
|
||||
|
||||
$this->assert_config_count($db, 5);
|
||||
}
|
||||
@@ -163,23 +147,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
|
||||
|
||||
$this->assert_config_count($db, 2);
|
||||
|
||||
$this->assertTrue($buffer->insert_all(array(
|
||||
array(
|
||||
'config_name' => 'name1',
|
||||
'config_value' => 'value1',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name2',
|
||||
'config_value' => 'value2',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name3',
|
||||
'config_value' => 'value3',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
)));
|
||||
$this->assertTrue($buffer->insert_all($this->get_three_rows()));
|
||||
|
||||
$this->assert_config_count($db, 4);
|
||||
|
||||
@@ -197,4 +165,25 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
|
||||
$this->assertEquals($num_configs, $db->sql_fetchfield('num_configs'));
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
protected function get_three_rows()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
'config_name' => 'name1',
|
||||
'config_value' => 'value1',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name2',
|
||||
'config_value' => 'value2',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
array(
|
||||
'config_name' => 'name3',
|
||||
'config_value' => 'value3',
|
||||
'is_dynamic' => '0',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user