diff options
author | brunoais <brunoaiss@gmail.com> | 2015-03-15 20:31:19 +0000 |
---|---|---|
committer | brunoais <brunoaiss@gmail.com> | 2015-03-16 23:16:47 +0000 |
commit | d60d596f25b0c31526f469cf56c4cdb1e3698bda (patch) | |
tree | 69f2a278a29a20efb8fab232deb707a44e6ba42c /tests/dbal/boolean_processor_test.php | |
parent | 1754f1832d563074e767f236cbc315eb41c7b7b9 (diff) | |
download | forums-d60d596f25b0c31526f469cf56c4cdb1e3698bda.tar forums-d60d596f25b0c31526f469cf56c4cdb1e3698bda.tar.gz forums-d60d596f25b0c31526f469cf56c4cdb1e3698bda.tar.bz2 forums-d60d596f25b0c31526f469cf56c4cdb1e3698bda.tar.xz forums-d60d596f25b0c31526f469cf56c4cdb1e3698bda.zip |
[feature/sql-bool-builder] test_single_not_in
PHPBB3-13652
Diffstat (limited to 'tests/dbal/boolean_processor_test.php')
-rw-r--r-- | tests/dbal/boolean_processor_test.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/dbal/boolean_processor_test.php b/tests/dbal/boolean_processor_test.php index e615edbdcd..a94085b77d 100644 --- a/tests/dbal/boolean_processor_test.php +++ b/tests/dbal/boolean_processor_test.php @@ -21,6 +21,32 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/boolean_processor.xml'); } + public function test_single_not_in() + { + $db = $this->new_dbal(); + + $db->sql_return_on_error(true); + + $sql_ary = array( + 'SELECT' => 'u.user_id', + 'FROM' => array( + 'phpbb_users' => 'u', + ), + 'WHERE' => array('u.user_id', 'NOT_IN', array(3,4,5)), + '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' => '6'), + ), $db->sql_fetchrowset($result)); + } + public function test_single_in() { $db = $this->new_dbal(); |