mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +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
|
@ -1001,6 +1001,25 @@ class DboSourceTest extends UnitTestCase {
|
|||
$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'));
|
||||
$this->assertPattern("/^\s+WHERE\s+`Candy`.`name` LIKE\s+'a'\s+AND\s+`HardCandy`.`name`\s+LIKE\s+'c'/", $result);
|
||||
|
|
Loading…
Reference in a new issue