aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2015-03-15 20:31:46 +0000
committerbrunoais <brunoaiss@gmail.com>2015-03-16 23:16:49 +0000
commitbc6ea5796dcdabd57ff9e6f7640d724df67254c5 (patch)
tree59a8ad438d79588e8af139ca4199309ecedbce05 /tests/dbal
parentc342531872938797f52f3e6bdfa966d81e3253ce (diff)
downloadforums-bc6ea5796dcdabd57ff9e6f7640d724df67254c5.tar
forums-bc6ea5796dcdabd57ff9e6f7640d724df67254c5.tar.gz
forums-bc6ea5796dcdabd57ff9e6f7640d724df67254c5.tar.bz2
forums-bc6ea5796dcdabd57ff9e6f7640d724df67254c5.tar.xz
forums-bc6ea5796dcdabd57ff9e6f7640d724df67254c5.zip
[feature/sql-bool-builder] test_single_not_like
PHPBB3-13652
Diffstat (limited to 'tests/dbal')
-rw-r--r--tests/dbal/boolean_processor_test.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/dbal/boolean_processor_test.php b/tests/dbal/boolean_processor_test.php
index 8f57a8e452..2ba3f6ff22 100644
--- a/tests/dbal/boolean_processor_test.php
+++ b/tests/dbal/boolean_processor_test.php
@@ -21,6 +21,33 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/boolean_processor.xml');
}
+ public function test_single_not_like()
+ {
+ $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.username_clean', 'NOT_LIKE', 'gr' . $db->get_any_char()),
+ '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'),
+ array('user_id' => '6'),
+ ), $db->sql_fetchrowset($result));
+ }
+
public function test_single_like()
{
$db = $this->new_dbal();