diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-03-27 23:30:23 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-03-28 00:28:46 +0100 |
commit | 873f098b6ccc108dc293054f2cf7cb7231684caa (patch) | |
tree | 18c235146d2f6dddc8c3f7f370e3a0977b0df860 /tests/dbal/sql_insert_buffer_test.php | |
parent | a534497d82cb9febaa18ee6c858ef68217bc2d14 (diff) | |
download | forums-873f098b6ccc108dc293054f2cf7cb7231684caa.tar forums-873f098b6ccc108dc293054f2cf7cb7231684caa.tar.gz forums-873f098b6ccc108dc293054f2cf7cb7231684caa.tar.bz2 forums-873f098b6ccc108dc293054f2cf7cb7231684caa.tar.xz forums-873f098b6ccc108dc293054f2cf7cb7231684caa.zip |
[ticket/11469] Do not repeat array with three rows.
PHPBB3-11469
Diffstat (limited to 'tests/dbal/sql_insert_buffer_test.php')
-rw-r--r-- | tests/dbal/sql_insert_buffer_test.php | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php index 0cf476b14a..59bfb73d0f 100644 --- a/tests/dbal/sql_insert_buffer_test.php +++ b/tests/dbal/sql_insert_buffer_test.php @@ -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', + ), + ); + } } |