mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Add tests for uncovered case of :0 replacements.
There were previously no tests for the :0, :1 style replacement markers in DboSource. In fact I didn't even know it was a 'feature'.
This commit is contained in:
parent
1cb7e4f0ff
commit
1daa27c0d7
1 changed files with 19 additions and 0 deletions
|
@ -2506,6 +2506,25 @@ class MysqlTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test conditions() with replacements.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testConditionsWithReplacements() {
|
||||||
|
$result = $this->Dbo->conditions(array(
|
||||||
|
'score BETWEEN :0 AND :1' => array(90.1, 95.7)
|
||||||
|
));
|
||||||
|
$expected = " WHERE `score` BETWEEN 90.1 AND 95.7";
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
$result = $this->Dbo->conditions(array(
|
||||||
|
'score BETWEEN ? AND ?' => array(90.1, 95.7)
|
||||||
|
));
|
||||||
|
$expected = " WHERE `score` BETWEEN 90.1 AND 95.7";
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that array conditions with only one element work.
|
* Test that array conditions with only one element work.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue