aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-03-27 23:53:03 +0100
committerAndreas Fischer <bantu@phpbb.com>2013-03-28 00:28:51 +0100
commit6f946e2188d08bdc939e56143bff9e663c0b6931 (patch)
treef0a0d5328bb7ea3363c7d2644c9c47232c20fa23 /tests
parenteacd0f3e7d200924a1d98d1ce34a454eda707dd4 (diff)
downloadforums-6f946e2188d08bdc939e56143bff9e663c0b6931.tar
forums-6f946e2188d08bdc939e56143bff9e663c0b6931.tar.gz
forums-6f946e2188d08bdc939e56143bff9e663c0b6931.tar.bz2
forums-6f946e2188d08bdc939e56143bff9e663c0b6931.tar.xz
forums-6f946e2188d08bdc939e56143bff9e663c0b6931.zip
[ticket/11469] Refactor get_three_rows() into get_rows($n).
PHPBB3-11469
Diffstat (limited to 'tests')
-rw-r--r--tests/dbal/sql_insert_buffer_test.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php
index bd03fb9c05..f06df26b0c 100644
--- a/tests/dbal/sql_insert_buffer_test.php
+++ b/tests/dbal/sql_insert_buffer_test.php
@@ -90,7 +90,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
{
$this->db->multi_insert = false;
- $this->assertTrue($this->buffer->insert_all($this->get_three_rows()));
+ $this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
$this->assert_config_count(5);
}
@@ -102,7 +102,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
$this->markTestSkipped('Database does not support multi_insert');
}
- $this->assertTrue($this->buffer->insert_all($this->get_three_rows()));
+ $this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
$this->assert_config_count(4);
@@ -130,12 +130,13 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
);
}
- protected function get_three_rows()
+ protected function get_rows($n)
{
- return array(
- $this->get_row(1),
- $this->get_row(2),
- $this->get_row(3),
- );
+ $result = array();
+ for ($i = 0; $i < $n; ++$i)
+ {
+ $result[] = $this->get_row($i);
+ }
+ return $result;
}
}