DoctrineExtension example

use Shopware\Core\Profiling\Twig\DoctrineExtension;

/** * @internal * * @covers \Shopware\Core\Profiling\Twig\DoctrineExtension */
class DoctrineExtensionTest extends TestCase
{
    public function testReplaceQueryParametersWithPostgresCasting(): void
    {
        $extension = new DoctrineExtension();
        $query = 'a=? OR (1)::string OR b=?';
        $parameters = [1, 2];

        $result = $extension->replaceQueryParameters($query$parameters);
        static::assertEquals('a=1 OR (1)::string OR b=2', $result);
    }

    public function testReplaceQueryParametersWithStartingIndexAtOne(): void
    {
        $extension = new DoctrineExtension();
        $query = 'a=? OR b=?';
        
Home | Imprint | This part of the site doesn't use cookies.