"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/framework/db/QueryBuilderTest.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

QueryBuilderTest.php  (yii2-2.0.35):QueryBuilderTest.php  (yii2-2.0.36)
skipping to change at line 2490 skipping to change at line 2490
// like object conditions // like object conditions
[new LikeCondition('name', 'like', new Expression('CONCAT("test", na me, "%")')), '[[name]] LIKE CONCAT("test", name, "%")', []], [new LikeCondition('name', 'like', new Expression('CONCAT("test", na me, "%")')), '[[name]] LIKE CONCAT("test", name, "%")', []],
[new LikeCondition('name', 'not like', new Expression('CONCAT("test" , name, "%")')), '[[name]] NOT LIKE CONCAT("test", name, "%")', []], [new LikeCondition('name', 'not like', new Expression('CONCAT("test" , name, "%")')), '[[name]] NOT LIKE CONCAT("test", name, "%")', []],
[new LikeCondition('name', 'or like', new Expression('CONCAT("test", name, "%")')), '[[name]] LIKE CONCAT("test", name, "%")', []], [new LikeCondition('name', 'or like', new Expression('CONCAT("test", name, "%")')), '[[name]] LIKE CONCAT("test", name, "%")', []],
[new LikeCondition('name', 'or not like', new Expression('CONCAT("te st", name, "%")')), '[[name]] NOT LIKE CONCAT("test", name, "%")', []], [new LikeCondition('name', 'or not like', new Expression('CONCAT("te st", name, "%")')), '[[name]] NOT LIKE CONCAT("test", name, "%")', []],
[new LikeCondition('name', 'like', [new Expression('CONCAT("test", n ame, "%")'), '\ab_c']), '[[name]] LIKE CONCAT("test", name, "%") AND [[name]] LI KE :qp0', [':qp0' => '%\\\ab\_c%']], [new LikeCondition('name', 'like', [new Expression('CONCAT("test", n ame, "%")'), '\ab_c']), '[[name]] LIKE CONCAT("test", name, "%") AND [[name]] LI KE :qp0', [':qp0' => '%\\\ab\_c%']],
[new LikeCondition('name', 'not like', [new Expression('CONCAT("test ", name, "%")'), '\ab_c']), '[[name]] NOT LIKE CONCAT("test", name, "%") AND [[n ame]] NOT LIKE :qp0', [':qp0' => '%\\\ab\_c%']], [new LikeCondition('name', 'not like', [new Expression('CONCAT("test ", name, "%")'), '\ab_c']), '[[name]] NOT LIKE CONCAT("test", name, "%") AND [[n ame]] NOT LIKE :qp0', [':qp0' => '%\\\ab\_c%']],
[new LikeCondition('name', 'or like', [new Expression('CONCAT("test" , name, "%")'), '\ab_c']), '[[name]] LIKE CONCAT("test", name, "%") OR [[name]] LIKE :qp0', [':qp0' => '%\\\ab\_c%']], [new LikeCondition('name', 'or like', [new Expression('CONCAT("test" , name, "%")'), '\ab_c']), '[[name]] LIKE CONCAT("test", name, "%") OR [[name]] LIKE :qp0', [':qp0' => '%\\\ab\_c%']],
[new LikeCondition('name', 'or not like', [new Expression('CONCAT("t est", name, "%")'), '\ab_c']), '[[name]] NOT LIKE CONCAT("test", name, "%") OR [ [name]] NOT LIKE :qp0', [':qp0' => '%\\\ab\_c%']], [new LikeCondition('name', 'or not like', [new Expression('CONCAT("t est", name, "%")'), '\ab_c']), '[[name]] NOT LIKE CONCAT("test", name, "%") OR [ [name]] NOT LIKE :qp0', [':qp0' => '%\\\ab\_c%']],
// like with expression as columnName
[['like', new Expression('name'), 'teststring'], 'name LIKE :qp0', [
':qp0' => "%teststring%"]],
]; ];
// adjust dbms specific escaping // adjust dbms specific escaping
foreach ($conditions as $i => $condition) { foreach ($conditions as $i => $condition) {
$conditions[$i][1] = $this->replaceQuotes($condition[1]); $conditions[$i][1] = $this->replaceQuotes($condition[1]);
if (!empty($this->likeEscapeCharSql)) { if (!empty($this->likeEscapeCharSql)) {
preg_match_all('/(?P<condition>LIKE.+?)( AND| OR|$)/', $conditio ns[$i][1], $matches, PREG_SET_ORDER); preg_match_all('/(?P<condition>LIKE.+?)( AND| OR|$)/', $conditio ns[$i][1], $matches, PREG_SET_ORDER);
foreach ($matches as $match) { foreach ($matches as $match) {
$conditions[$i][1] = str_replace($match['condition'], $match ['condition'] . $this->likeEscapeCharSql, $conditions[$i][1]); $conditions[$i][1] = str_replace($match['condition'], $match ['condition'] . $this->likeEscapeCharSql, $conditions[$i][1]);
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)