aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/select_test.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-10-13 16:56:55 +0200
committerIgor Wiedler <igor@wiedler.ch>2011-10-13 16:57:42 +0200
commit6d9e9d190179a33ec8873f206f75db0978992bf6 (patch)
treec7743e298c4825ae0827fb4064f0dab62a47e4d4 /tests/dbal/select_test.php
parent3cd8c2507d4181a32484e47d6eef6601485bfb25 (diff)
downloadforums-6d9e9d190179a33ec8873f206f75db0978992bf6.tar
forums-6d9e9d190179a33ec8873f206f75db0978992bf6.tar.gz
forums-6d9e9d190179a33ec8873f206f75db0978992bf6.tar.bz2
forums-6d9e9d190179a33ec8873f206f75db0978992bf6.tar.xz
forums-6d9e9d190179a33ec8873f206f75db0978992bf6.zip
[ticket/10307] Add a test for PHPBB3-10307
PHPBB3-10307
Diffstat (limited to 'tests/dbal/select_test.php')
-rw-r--r--tests/dbal/select_test.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index e0d08d9306..8ddd27465d 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -319,7 +319,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- function test_nested_transactions()
+ public function test_nested_transactions()
{
$db = $this->new_dbal();
@@ -341,4 +341,20 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals('1', $row['user_id']);
}
+
+ /**
+ * fix for PHPBB3-10307
+ */
+ public function test_sql_fetchrow_returns_false_when_empty()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT * FROM (SELECT 1) AS TBL WHERE 1 = 0';
+ $result = $db->sql_query($sql);
+
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $this->assertSame(false, $row);
+ }
}