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', + ), + ); + } }