aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/select_test.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-07-21 15:36:25 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-07-21 15:36:25 +0200
commit5d57caee58c58d2a9c283abe8fe88f4eaec9f662 (patch)
treecd36469a74bf6847e5305d1fb8f4ac35266813e2 /tests/dbal/select_test.php
parent3ebe89cb7eff57c3ffdbe0b7dcd9cdc35b48d26b (diff)
parent841ea0e494504400c798faa6cc860dd1179e1004 (diff)
downloadforums-5d57caee58c58d2a9c283abe8fe88f4eaec9f662.tar
forums-5d57caee58c58d2a9c283abe8fe88f4eaec9f662.tar.gz
forums-5d57caee58c58d2a9c283abe8fe88f4eaec9f662.tar.bz2
forums-5d57caee58c58d2a9c283abe8fe88f4eaec9f662.tar.xz
forums-5d57caee58c58d2a9c283abe8fe88f4eaec9f662.zip
Merge branch 'develop' into feature/dic
* develop: (441 commits) [feature/new-tz-handling] Don't use global user but make it a parameter [feature/new-tz-handling] Fix size of suggestion button in chrome [feature/new-tz-handling] Fall back to UTC, if the timezone is invalid [feature/new-tz-handling] Add previous selected value to validation if valid [feature/new-tz-handling] Display suggestion when a different value is selected [ticket/10998] Add border-radius to forum rules block - prosilver [feature/new-tz-handling] Remove additional marking of selected items [feature/new-tz-handling] Move update helper function to new class [feature/new-tz-handling] Fix unit test [feature/new-tz-handling] Delete old variable which is not used anymore [feature/new-tz-handling] Rename $user->tz back to $user->timezone [feature/pagination-as-list] New parameter for name of start var [feature/pagination-as-list] Updates for nils comments [feature/pagination-as-list] Rename and deprecate functions [feature/pagination-as-list] Various fixes and improvements [ticket/10968] Render pagination within the template [feature/new-tz-handling] Remove "timezone might be numeric" [feature/new-tz-handling] Add function to update the timezone [feature/new-tz-handling] Correctly update user and board timezones on update [ticket/10996] Use correct DBMS name in Travis config for PostgreSQL ... Conflicts: phpBB/common.php phpBB/composer.json phpBB/composer.lock tests/cron/task_provider_test.php
Diffstat (limited to 'tests/dbal/select_test.php')
-rw-r--r--tests/dbal/select_test.php32
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index cc213f09bc..bd524100a2 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -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'),
@@ -349,7 +375,9 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $sql = 'SELECT * FROM (SELECT 1) AS TBL WHERE 1 = 0';
+ $sql = 'SELECT user_id
+ FROM phpbb_users
+ WHERE 1 = 0';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);