Unverified Commit de2bfb12 authored by Grégoire Paris's avatar Grégoire Paris Committed by Grégoire Paris
parent 20d07bff
......@@ -2,6 +2,7 @@
namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\Tests\DbalFunctionalTestCase;
final class LikeWildcardsEscapingTest extends DbalFunctionalTestCase
......@@ -10,10 +11,12 @@ final class LikeWildcardsEscapingTest extends DbalFunctionalTestCase
{
$string = '_25% off_ your next purchase \o/';
$escapeChar = '!';
$databasePlatform = $this->_conn->getDatabasePlatform();
$stmt = $this->_conn->prepare(sprintf(
"SELECT '%s' LIKE '%s' ESCAPE '%s' as it_matches",
"SELECT (CASE WHEN '%s' LIKE '%s' ESCAPE '%s' THEN 1 ELSE 0 END)" .
($databasePlatform instanceof OraclePlatform ? ' FROM dual' : ''),
$string,
$this->_conn->getDatabasePlatform()->escapeStringForLike($string, $escapeChar),
$databasePlatform->escapeStringForLike($string, $escapeChar),
$escapeChar
));
$stmt->execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment