| Conditions | 2 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function testFetchLikeExpressionResult() : void |
||
| 11 | { |
||
| 12 | $string = '_25% off_ your next purchase \o/'; |
||
| 13 | $escapeChar = '!'; |
||
| 14 | $databasePlatform = $this->_conn->getDatabasePlatform(); |
||
| 15 | $stmt = $this->_conn->prepare(sprintf( |
||
| 16 | "SELECT '%s' LIKE '%s' ESCAPE '%s' as it_matches" . |
||
| 17 | ($databasePlatform instanceof OraclePlatform ? ' FROM dual' : ''), |
||
| 18 | $string, |
||
| 19 | $databasePlatform->escapeStringForLike($string, $escapeChar), |
||
| 20 | $escapeChar |
||
| 21 | )); |
||
| 22 | $stmt->execute(); |
||
| 23 | $this->assertTrue((bool) $stmt->fetchColumn()); |
||
| 24 | } |
||
| 26 |