diff options
author | brunoais <brunoaiss@gmail.com> | 2015-03-15 20:30:35 +0000 |
---|---|---|
committer | brunoais <brunoaiss@gmail.com> | 2015-03-16 23:16:47 +0000 |
commit | 1754f1832d563074e767f236cbc315eb41c7b7b9 (patch) | |
tree | 6dab3c1d877c261681e091a2dc86ae0528f4852a /tests/dbal | |
parent | [feature/sql-bool-builder] test_and_of_or_of_and (diff) | |
download | phpbb-1754f1832d563074e767f236cbc315eb41c7b7b9.tar.gz phpbb-1754f1832d563074e767f236cbc315eb41c7b7b9.tar.bz2 phpbb-1754f1832d563074e767f236cbc315eb41c7b7b9.zip |
[feature/sql-bool-builder] test_single_in
PHPBB3-13652
Diffstat (limited to 'tests/dbal')
-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 716e524e9b..e615edbdcd 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_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', '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' => '3'), + array('user_id' => '4'), + array('user_id' => '5'), + ), $db->sql_fetchrowset($result)); + } + public function test_and_of_or_of_and() { $db = $this->new_dbal(); |