mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added tests for issue #1100
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4811 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
784ee985b5
commit
5e2d4167e3
1 changed files with 19 additions and 0 deletions
|
@ -1000,6 +1000,25 @@ class DboSourceTest extends UnitTestCase {
|
|||
$expected = " WHERE DATEDIFF(NOW(),`Article`.`published`) < 1 && `Article`.`live`=1";
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testQuotesInStringConditions() {
|
||||
$result = $this->db->conditions('Member.email = \'mariano@cricava.com\'');
|
||||
$expected = ' WHERE `Member`.`email` = \'mariano@cricava.com\'';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->db->conditions('Member.email = "mariano@cricava.com"');
|
||||
$expected = ' WHERE `Member`.`email` = "mariano@cricava.com"';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->db->conditions('Member.email = \'mariano@cricava.com\' AND Member.user LIKE \'mariano.iglesias%\'');
|
||||
$expected = ' WHERE `Member`.`email` = \'mariano@cricava.com\' AND `Member`.`user` LIKE \'mariano.iglesias%\'';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
|
||||
$result = $this->db->conditions('Member.email = "mariano@cricava.com" AND Member.user LIKE "mariano.iglesias%"');
|
||||
$expected = ' WHERE `Member`.`email` = "mariano@cricava.com" AND `Member`.`user` LIKE "mariano.iglesias%"';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testArrayConditionsParsing() {
|
||||
$result = $this->db->conditions(array('Candy.name' => 'LIKE a', 'HardCandy.name' => 'LIKE c'));
|
||||
|
|
Loading…
Reference in a new issue