diff options
author | brunoais <brunoaiss@gmail.com> | 2015-03-15 20:25:55 +0000 |
---|---|---|
committer | brunoais <brunoaiss@gmail.com> | 2015-03-16 23:15:58 +0000 |
commit | d10a0ca1ca48d8d348922a806f14f63360179d50 (patch) | |
tree | 9eac191b4963978c14f45836014089a3ba3949b2 /tests/dbal | |
parent | 5bc03c961023e01dfb74eff296b12b6169d705e4 (diff) | |
download | forums-d10a0ca1ca48d8d348922a806f14f63360179d50.tar forums-d10a0ca1ca48d8d348922a806f14f63360179d50.tar.gz forums-d10a0ca1ca48d8d348922a806f14f63360179d50.tar.bz2 forums-d10a0ca1ca48d8d348922a806f14f63360179d50.tar.xz forums-d10a0ca1ca48d8d348922a806f14f63360179d50.zip |
[feature/sql-bool-builder] test_triple_and_with_is_null
PHPBB3-13652
Diffstat (limited to 'tests/dbal')
-rw-r--r-- | tests/dbal/boolean_processor_test.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/dbal/boolean_processor_test.php b/tests/dbal/boolean_processor_test.php index f80e12ad4f..652cb1164b 100644 --- a/tests/dbal/boolean_processor_test.php +++ b/tests/dbal/boolean_processor_test.php @@ -21,4 +21,41 @@ 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_is_null() + { + $db = $this->new_dbal(); + + $db->sql_return_on_error(true); + + $sql_ary = array( + 'SELECT' => 'u.username', + 'FROM' => array( + 'phpbb_users' => 'u', + 'phpbb_user_group' => 'ug', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array( + 'phpbb_banlist' => 'b', + ), + 'ON' => 'u.user_id = b.ban_userid', + ), + ), + 'WHERE' => array('AND', + array('ug.group_id', '=', 1), + array('u.user_id', '=', 'ug.user_id'), + array('b.ban_id', 'IS', NULL), + ), + 'ORDER_BY' => 'u.username', + ); + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + $this->assertEquals(array( + array('username' => 'helper'), + array('username' => 'mass email'), + ), $db->sql_fetchrowset($result)); + } } |