mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-26 04:52:36 +01:00
[feature/sql-bool-builder] Improved tests output to show the SQL error.
PHPBB3-13652
This commit is contained in:
parent
576eaa0cff
commit
fe132f19e8
@ -45,7 +45,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
array('user_id' => '2'),
|
||||
array('user_id' => '3'),
|
||||
array('user_id' => '6'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_single_like()
|
||||
@ -70,7 +74,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
$this->assertEquals(array(
|
||||
array('user_id' => '4'),
|
||||
array('user_id' => '5'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_single_not_in()
|
||||
@ -96,7 +104,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
array('user_id' => '1'),
|
||||
array('user_id' => '2'),
|
||||
array('user_id' => '6'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_single_in()
|
||||
@ -122,7 +134,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
array('user_id' => '3'),
|
||||
array('user_id' => '4'),
|
||||
array('user_id' => '5'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_and_of_or_of_and()
|
||||
@ -168,7 +184,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
$this->assertEquals(array(
|
||||
array('user_id' => '2'),
|
||||
array('user_id' => '4'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_triple_and_with_in()
|
||||
@ -200,6 +220,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
array('user_id' => '2'),
|
||||
array('user_id' => '3'),
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function test_double_and_with_not_of_or()
|
||||
@ -230,7 +255,11 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
|
||||
$db->sql_return_on_error(false);
|
||||
|
||||
$this->assertEquals(array(), $db->sql_fetchrowset($result));
|
||||
$this->assertEquals(array(), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_triple_and_with_is_null()
|
||||
@ -268,6 +297,10 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||
$this->assertEquals(array(
|
||||
array('username' => 'helper'),
|
||||
array('username' => 'mass email'),
|
||||
), $db->sql_fetchrowset($result));
|
||||
), $db->sql_fetchrowset($result),
|
||||
($result === false) ?
|
||||
"SQL ERROR:<br>" . var_export($sql, true) . "<br>" . $db->sql_error() :
|
||||
var_export($sql, true) . ' ' . var_export($result, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user