1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/10858] Move generic row seeking to DBAL
  [ticket/10858] Tests for row seeking with fetchfield()
  [ticket/10858] Fix MSSQL Native's row seeking behavior

Conflicts:
	tests/dbal/select_test.php
This commit is contained in:
Andreas Fischer
2012-05-09 12:55:58 +02:00
5 changed files with 70 additions and 105 deletions

View File

@@ -125,7 +125,33 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary);
}
public function query_limit_data()
public static function fetchfield_seek_data()
{
return array(
array(1, 'foobar'),
array(0, 'barfoo'),
array(2, 'bertie'),
);
}
/**
* @dataProvider fetchfield_seek_data
*/
public function test_fetchfield_seek($rownum, $expected)
{
$db = $this->new_dbal();
$result = $db->sql_query('SELECT username_clean
FROM phpbb_users
ORDER BY user_id ASC');
$field = $db->sql_fetchfield('username_clean', $rownum, $result);
$db->sql_freeresult($result);
$this->assertEquals($expected, $field);
}
public static function query_limit_data()
{
return array(
array(0, 0, array(array('username_clean' => 'barfoo'),