<commit_before><?php

namespace Syslogic\DoctrineJsonFunctions\Tests\Query\Functions\Mysql;

use Syslogic\DoctrineJsonFunctions\Tests\Query\MysqlTestCase;
use Doctrine\ORM\Query\Expr;

class JsonArrayTest extends MysqlTestCase
{
    public function testJsonArray()
    {
        $this->assertDqlProducesSql(
            "SELECT JSON_ARRAY(1, 'abc', NULL, b.id, CURRENT_TIME(), CONCAT('a','my')) from Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank b",
            "SELECT JSON_ARRAY(1, 'abc', NULL, b0_.id, CURRENT_TIME, CONCAT('a', 'my')) AS sclr_0 FROM Blank b0_"
        );
    }
    public function testJsonArrayEmpty()
    {
        $this->assertDqlProducesSql(
            "SELECT JSON_ARRAY() from Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank b",
            "SELECT JSON_ARRAY() AS sclr_0 FROM Blank b0_"
        );
    }

    public function testJsonArrayBool()
    {
        $qb = $this->entityManager->createQueryBuilder();

        $query = $qb->select(new Expr\Func('JSON_ARRAY', [$qb->expr()->literal(true)]))
            ->from('Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank', 'b');

        $this->assertDqlProducesSql(
            $query->getDQL(),
            "SELECT JSON_ARRAY(TRUE) AS sclr_0 FROM Blank b0_"
        );
    }<commit_msg>test adjusted for TRUE literal<commit_after><?php

namespace Syslogic\DoctrineJsonFunctions\Tests\Query\Functions\Mysql;

use Syslogic\DoctrineJsonFunctions\Tests\Query\MysqlTestCase;
use Doctrine\ORM\Query\Expr;

class JsonArrayTest extends MysqlTestCase
{
    public function testJsonArray()
    {
        $this->assertDqlProducesSql(
            "SELECT JSON_ARRAY(1, 'abc', NULL, b.id, CURRENT_TIME(), CONCAT('a','my')) from Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank b",
            "SELECT JSON_ARRAY(1, 'abc', NULL, b0_.id, CURRENT_TIME, CONCAT('a', 'my')) AS sclr_0 FROM Blank b0_"
        );
    }
    public function testJsonArrayEmpty()
    {
        $this->assertDqlProducesSql(
            "SELECT JSON_ARRAY() from Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank b",
            "SELECT JSON_ARRAY() AS sclr_0 FROM Blank b0_"
        );
    }

    public function testJsonArrayBool()
    {
        $qb = $this->entityManager->createQueryBuilder();

        $query = $qb->select(new Expr\Func('JSON_ARRAY', [$qb->expr()->literal(true)]))
            ->from('Syslogic\DoctrineJsonFunctions\Tests\Entities\Blank', 'b');

        $this->assertDqlProducesSql(
            $query->getDQL(),
            "SELECT JSON_ARRAY(1) AS sclr_0 FROM Blank b0_"
        );
    }
{'fraction_non_alphanumeric': 0.13036690085870414, 'fraction_numerical': 0.00741608118657299, 'mean_word_length': 3.0747217806041336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6123252', 'n_tokens_mistral': 851, 'n_tokens_neox': 815, 'n_words': 152}