aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2015-03-15 20:29:48 +0000
committerbrunoais <brunoaiss@gmail.com>2015-03-16 23:16:43 +0000
commite6eab35a641b8795f8a277e28d3eab0937d64b6d (patch)
treed581e85686b2582ecdf32d04d30e655a5587f2f2 /tests/dbal
parent5d3b22c21e2c31dce80d3a4c84fd5a0a326f944f (diff)
downloadforums-e6eab35a641b8795f8a277e28d3eab0937d64b6d.tar
forums-e6eab35a641b8795f8a277e28d3eab0937d64b6d.tar.gz
forums-e6eab35a641b8795f8a277e28d3eab0937d64b6d.tar.bz2
forums-e6eab35a641b8795f8a277e28d3eab0937d64b6d.tar.xz
forums-e6eab35a641b8795f8a277e28d3eab0937d64b6d.zip
[feature/sql-bool-builder] test_triple_and_with_in
PHPBB3-13652
Diffstat (limited to 'tests/dbal')
-rw-r--r--tests/dbal/boolean_processor_test.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/dbal/boolean_processor_test.php b/tests/dbal/boolean_processor_test.php
index 40efbe8d5a..081a5ac64d 100644
--- a/tests/dbal/boolean_processor_test.php
+++ b/tests/dbal/boolean_processor_test.php
@@ -21,6 +21,37 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/boolean_processor.xml');
}
+ public function test_triple_and_with_in()
+ {
+ $db = $this->new_dbal();
+
+ $db->sql_return_on_error(true);
+
+ $sql_ary = array(
+ 'SELECT' => 'u.user_id',
+ 'FROM' => array(
+ 'phpbb_users' => 'u',
+ 'phpbb_user_group' => 'ug',
+ ),
+ 'WHERE' => array('AND',
+ array('ug.user_id', 'IN', array(1, 2, 3, 4)),
+ array('ug.group_id', '=', 1),
+ array('u.user_id', '=', 'ug.user_id'),
+ ),
+ 'ORDER_BY' => 'u.user_id',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
+ $result = $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ $this->assertEquals(array(
+ array('user_id' => '1'),
+ array('user_id' => '2'),
+ array('user_id' => '3'),
+ ), $db->sql_fetchrowset($result),
+ }
+
public function test_double_and_with_not_of_or()
{
$db = $this->new_dbal();