mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[feature/sql-bool-builder] test_single_in
PHPBB3-13652
This commit is contained in:
parent
5f63d685f6
commit
1754f1832d
1 changed files with 26 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue