Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\ArrayPosition;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseVariadicFunction;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use PHPUnit\Framework\Attributes\Test;

class ArrayPositionTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -43,7 +44,8 @@ protected function getDqlStatements(): array
];
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('array_position() requires at least 2 arguments');
Expand All @@ -52,7 +54,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('array_position() requires between 2 and 3 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseVariadicFunction;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use PHPUnit\Framework\Attributes\Test;

class ArrayToJsonTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -40,7 +41,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for array_to_json. Must be "true" or "false".');
Expand All @@ -49,7 +51,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('array_to_json() requires between 1 and 2 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\DateAdd;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidTimezoneException;
use PHPUnit\Framework\Attributes\Test;

class DateAddTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_timezone_throws_exception(): void
#[Test]
public function invalid_timezone_throws_exception(): void
{
$this->expectException(InvalidTimezoneException::class);
$this->expectExceptionMessage('Invalid timezone "Invalid/Timezone" provided for date_add');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_timezone_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('date_add() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('date_add() requires between 2 and 3 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\DateSubtract;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidTimezoneException;
use PHPUnit\Framework\Attributes\Test;

class DateSubtractTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -42,7 +43,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_timezone_throws_exception(): void
#[Test]
public function invalid_timezone_throws_exception(): void
{
$this->expectException(InvalidTimezoneException::class);
$this->expectExceptionMessage('Invalid timezone "Invalid/Timezone" provided for date_subtract');
Expand All @@ -51,7 +53,8 @@ public function test_invalid_timezone_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('date_subtract() requires at least 2 arguments');
Expand All @@ -60,7 +63,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('date_subtract() requires between 2 and 3 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbInsert;
use PHPUnit\Framework\Attributes\Test;

class JsonbInsertTest extends TestCase
{
Expand All @@ -34,7 +35,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_insert. Must be "true" or "false".');
Expand All @@ -43,7 +45,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_insert() requires at least 3 arguments');
Expand All @@ -52,7 +55,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_insert() requires between 3 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbPathExists;
use PHPUnit\Framework\Attributes\Test;

class JsonbPathExistsTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_path_exists. Must be "true" or "false".');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_exists() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_exists() requires between 2 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbPathMatch;
use PHPUnit\Framework\Attributes\Test;

class JsonbPathMatchTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_path_match. Must be "true" or "false".');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_match() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_match() requires between 2 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbPathQueryArray;
use PHPUnit\Framework\Attributes\Test;

class JsonbPathQueryArrayTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_path_query_array. Must be "true" or "false".');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query_array() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query_array() requires between 2 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbPathQueryFirst;
use PHPUnit\Framework\Attributes\Test;

class JsonbPathQueryFirstTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_path_query_first. Must be "true" or "false".');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query_first() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query_first() requires between 2 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbPathQuery;
use PHPUnit\Framework\Attributes\Test;

class JsonbPathQueryTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_path_query. Must be "true" or "false".');
Expand All @@ -53,7 +55,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query() requires at least 2 arguments');
Expand All @@ -62,7 +65,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_path_query() requires between 2 and 4 arguments');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidArgumentForVariadicFunctionException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception\InvalidBooleanException;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\JsonbSet;
use PHPUnit\Framework\Attributes\Test;

class JsonbSetTest extends BaseVariadicFunctionTestCase
{
Expand Down Expand Up @@ -40,7 +41,8 @@ protected function getDqlStatements(): array
];
}

public function test_invalid_boolean_throws_exception(): void
#[Test]
public function invalid_boolean_throws_exception(): void
{
$this->expectException(InvalidBooleanException::class);
$this->expectExceptionMessage('Invalid boolean value "invalid" provided for jsonb_set. Must be "true" or "false".');
Expand All @@ -49,7 +51,8 @@ public function test_invalid_boolean_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_few_arguments_throws_exception(): void
#[Test]
public function too_few_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_set() requires at least 3 arguments');
Expand All @@ -58,7 +61,8 @@ public function test_too_few_arguments_throws_exception(): void
$this->buildEntityManager()->createQuery($dql)->getSQL();
}

public function test_too_many_arguments_throws_exception(): void
#[Test]
public function too_many_arguments_throws_exception(): void
{
$this->expectException(InvalidArgumentForVariadicFunctionException::class);
$this->expectExceptionMessage('jsonb_set() requires between 3 and 4 arguments');
Expand Down
Loading
Loading