Skip to content

Commit adeceee

Browse files
chore: tweak test infrastructure and add skeleton classes for running integration tests for functions against a real PostgreSQL versions (#375)
1 parent 3f04c0e commit adeceee

38 files changed

+839
-486
lines changed

fixtures/MartinGeorgiev/Doctrine/Entity/ContainsArrays.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44

55
namespace Fixtures\MartinGeorgiev\Doctrine\Entity;
66

7-
use Doctrine\DBAL\Types\Types;
87
use Doctrine\ORM\Mapping as ORM;
98

109
#[ORM\Entity()]
1110
class ContainsArrays extends Entity
1211
{
13-
#[ORM\Column(type: Types::JSON)]
14-
public array $array1;
12+
#[ORM\Column(type: 'text[]')]
13+
public array $textArray;
1514

16-
#[ORM\Column(type: Types::JSON)]
17-
public array $array2;
15+
#[ORM\Column(type: 'smallint[]')]
16+
public array $smallintArray;
17+
18+
#[ORM\Column(type: 'integer[]')]
19+
public array $integerArray;
20+
21+
#[ORM\Column(type: 'bigint[]')]
22+
public array $bigintArray;
23+
24+
#[ORM\Column(type: 'bool[]')]
25+
public array $boolArray;
1826
}

fixtures/MartinGeorgiev/Doctrine/Entity/Entity.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
use Doctrine\DBAL\Types\Types;
88
use Doctrine\ORM\Mapping as ORM;
99

10+
#[ORM\MappedSuperclass]
1011
abstract class Entity
1112
{
12-
#[ORM\Id()]
13-
#[ORM\Column(type: Types::STRING)]
14-
#[ORM\GeneratedValue()]
15-
public string $id;
13+
#[ORM\Id]
14+
#[ORM\Column(type: Types::INTEGER)]
15+
#[ORM\GeneratedValue]
16+
public int $id;
1617
}

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ArrayToJson.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*
1919
* @author Martin Georgiev <martin.georgiev@gmail.com>
2020
*
21-
* @example Using it in DQL: "SELECT ARRAY_TO_JSON(e.array1) FROM Entity e"
22-
* @example Using it in DQL with pretty_bool: "SELECT ARRAY_TO_JSON(e.array1, 'true') FROM Entity e"
21+
* @example Using it in DQL: "SELECT ARRAY_TO_JSON(e.textArray) FROM Entity e"
22+
* @example Using it in DQL with pretty_bool: "SELECT ARRAY_TO_JSON(e.textArray, 'true') FROM Entity e"
2323
*/
2424
class ArrayToJson extends BaseVariadicFunction
2525
{

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Overlaps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @author Martin Georgiev <martin.georgiev@gmail.com>
1414
*
15-
* @example Using it in DQL with boolean comparison: "WHERE OVERLAPS(e.array1, e.array2) = TRUE"
15+
* @example Using it in DQL with boolean comparison: "WHERE OVERLAPS(e.textArray, e.integerArray) = TRUE"
1616
* Returns boolean, must be used with "= TRUE" or "= FALSE" in DQL.
1717
*/
1818
class Overlaps extends BaseFunction

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/DBALTypesIntegrationTest.php

Lines changed: 0 additions & 241 deletions
This file was deleted.

0 commit comments

Comments
 (0)