-
-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from iBiryukov/master
Bug fix for SQL parameter replacing function.
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/* | ||
* This file is part of the Doctrine Bundle | ||
* | ||
* The code was originally distributed inside the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* (c) Doctrine Project, Benjamin Eberlei <kontakt@beberlei.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Tests\Twig; | ||
|
||
use Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension; | ||
|
||
class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testReplaceQueryParametersWithPostgresCasting() | ||
{ | ||
$extension = new DoctrineExtension(); | ||
$query = "a=? OR (1)::string OR b=?"; | ||
$parameters = array(1, 2); | ||
|
||
$result = $extension->replaceQueryParameters($query, $parameters, false); | ||
$this->assertEquals("a=1 OR (1)::string OR b=2", $result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters