mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Adding more tests for #2414
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4912 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5903e2226c
commit
6978359505
1 changed files with 38 additions and 2 deletions
|
@ -1286,11 +1286,47 @@ class DboSourceTest extends UnitTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testParenthesisInStringConditions() {
|
function testParenthesisInStringConditions() {
|
||||||
|
$result = $this->db->conditions('Member.name = \'(lu\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(lu\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \')lu\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\)lu\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'va(lu\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'va)lu\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\)lu\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'va(lu)\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'va(lu)e\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)e\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano)\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano)iglesias\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)iglesias\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano) iglesias\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\) iglesias\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano word) iglesias\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano word\) iglesias\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano.iglesias)\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\)\'$/', $result);
|
||||||
|
|
||||||
$result = $this->db->conditions('Member.name = \'Mariano Iglesias (mariano.iglesias)\'');
|
$result = $this->db->conditions('Member.name = \'Mariano Iglesias (mariano.iglesias)\'');
|
||||||
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result);
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result);
|
||||||
|
|
||||||
$result = $this->db->conditions('Member.name = "Mariano Iglesias (mariano.iglesias)"');
|
$result = $this->db->conditions('Member.name = \'Mariano Iglesias (mariano.iglesias) CakePHP\'');
|
||||||
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\"Mariano Iglesias \(mariano.iglesias\)\"$/', $result);
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\) CakePHP\'$/', $result);
|
||||||
|
|
||||||
|
$result = $this->db->conditions('Member.name = \'(mariano.iglesias) CakePHP\'');
|
||||||
|
$this->assertPattern('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\) CakePHP\'$/', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testParenthesisInArrayConditions() {
|
function testParenthesisInArrayConditions() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue