mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/11469] Do not repeat array with three rows.
PHPBB3-11469
This commit is contained in:
parent
a534497d82
commit
873f098b6c
1 changed files with 23 additions and 34 deletions
|
@ -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',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue