Skip to content

Commit fb76f39

Browse files
no message
1 parent d149bb6 commit fb76f39

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/AllTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
'SELECT c0_.id AS id_0 FROM ContainsArrays c0_ WHERE c0_.id > ALL(c0_.textArray)',
22+
'all elements match condition' => 'SELECT c0_.id AS id_0 FROM ContainsArrays c0_ WHERE c0_.id > ALL(c0_.textArray)',
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf('SELECT e.id FROM %s e WHERE e.id > ALL_OF(e.textArray)', ContainsArrays::class),
29+
'all elements match condition' => \sprintf('SELECT e.id FROM %s e WHERE e.id > ALL_OF(e.textArray)', ContainsArrays::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
'SELECT CEIL(c0_.decimal1) AS sclr_0 FROM ContainsDecimals c0_',
22+
'rounds decimal up to nearest integer' => 'SELECT CEIL(c0_.decimal1) AS sclr_0 FROM ContainsDecimals c0_',
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf('SELECT CEIL(e.decimal1) FROM %s e', ContainsDecimals::class),
29+
'rounds decimal up to nearest integer' => \sprintf('SELECT CEIL(e.decimal1) FROM %s e', ContainsDecimals::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FloorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
'SELECT FLOOR(c0_.decimal1) AS sclr_0 FROM ContainsDecimals c0_',
22+
'rounds decimal down to nearest integer' => 'SELECT FLOOR(c0_.decimal1) AS sclr_0 FROM ContainsDecimals c0_',
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf('SELECT FLOOR(e.decimal1) FROM %s e', ContainsDecimals::class),
29+
'rounds decimal down to nearest integer' => \sprintf('SELECT FLOOR(e.decimal1) FROM %s e', ContainsDecimals::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
"SELECT (c0_.text1 ~ '.*thomas.*') AS sclr_0 FROM ContainsTexts c0_",
22+
'matches text against regular expression pattern' => "SELECT (c0_.text1 ~ '.*thomas.*') AS sclr_0 FROM ContainsTexts c0_",
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf("SELECT REGEXP(e.text1, '.*thomas.*') FROM %s e", ContainsTexts::class),
29+
'matches text against regular expression pattern' => \sprintf("SELECT REGEXP(e.text1, '.*thomas.*') FROM %s e", ContainsTexts::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/StartsWithTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
"SELECT (STARTS_WITH(c0_.text1, 'TEST')) AS sclr_0 FROM ContainsTexts c0_",
22+
'checks if text starts with prefix' => "SELECT (STARTS_WITH(c0_.text1, 'TEST')) AS sclr_0 FROM ContainsTexts c0_",
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf("SELECT STARTS_WITH(e.text1,'TEST') FROM %s e", ContainsTexts::class),
29+
'checks if text starts with prefix' => \sprintf("SELECT STARTS_WITH(e.text1,'TEST') FROM %s e", ContainsTexts::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/StringToArrayTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ protected function getStringFunctions(): array
1919
protected function getExpectedSqlStatements(): array
2020
{
2121
return [
22-
"SELECT string_to_array(c0_.text1, ',') AS sclr_0 FROM ContainsTexts c0_",
22+
'splits text into array using comma delimiter' => "SELECT string_to_array(c0_.text1, ',') AS sclr_0 FROM ContainsTexts c0_",
2323
];
2424
}
2525

2626
protected function getDqlStatements(): array
2727
{
2828
return [
29-
\sprintf("SELECT STRING_TO_ARRAY(e.text1, ',') FROM %s e", ContainsTexts::class),
29+
'splits text into array using comma delimiter' => \sprintf("SELECT STRING_TO_ARRAY(e.text1, ',') FROM %s e", ContainsTexts::class),
3030
];
3131
}
3232
}

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ToCharTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ protected function getStringFunctions(): array
2222
protected function getExpectedSqlStatements(): array
2323
{
2424
return [
25-
"SELECT to_char(c0_.datetime1, 'HH12:MI:SS') AS sclr_0 FROM ContainsDates c0_",
26-
"SELECT to_char(c0_.dateinterval1, 'HH24:MI:SS') AS sclr_0 FROM ContainsDates c0_",
27-
"SELECT to_char(c0_.decimal1, '999D99S') AS sclr_0 FROM ContainsDecimals c0_",
25+
'formats datetime with 12-hour time' => "SELECT to_char(c0_.datetime1, 'HH12:MI:SS') AS sclr_0 FROM ContainsDates c0_",
26+
'formats interval with 24-hour time' => "SELECT to_char(c0_.dateinterval1, 'HH24:MI:SS') AS sclr_0 FROM ContainsDates c0_",
27+
'formats decimal with custom pattern' => "SELECT to_char(c0_.decimal1, '999D99S') AS sclr_0 FROM ContainsDecimals c0_",
2828
];
2929
}
3030

3131
protected function getDqlStatements(): array
3232
{
3333
return [
34-
\sprintf("SELECT TO_CHAR(e.datetime1, 'HH12:MI:SS') FROM %s e", ContainsDates::class),
35-
\sprintf("SELECT TO_CHAR(e.dateinterval1, 'HH24:MI:SS') FROM %s e", ContainsDates::class),
36-
\sprintf("SELECT TO_CHAR(e.decimal1, '999D99S') FROM %s e", ContainsDecimals::class),
34+
'formats datetime with 12-hour time' => \sprintf("SELECT TO_CHAR(e.datetime1, 'HH12:MI:SS') FROM %s e", ContainsDates::class),
35+
'formats interval with 24-hour time' => \sprintf("SELECT TO_CHAR(e.dateinterval1, 'HH24:MI:SS') FROM %s e", ContainsDates::class),
36+
'formats decimal with custom pattern' => \sprintf("SELECT TO_CHAR(e.decimal1, '999D99S') FROM %s e", ContainsDecimals::class),
3737
];
3838
}
3939

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/UnaccentTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ protected function getStringFunctions(): array
2727
protected function getExpectedSqlStatements(): array
2828
{
2929
return [
30-
'SELECT unaccent(c0_.text1) AS sclr_0 FROM ContainsTexts c0_',
31-
"SELECT unaccent('unaccent', c0_.text1) AS sclr_0 FROM ContainsTexts c0_",
30+
'removes accents with default dictionary' => 'SELECT unaccent(c0_.text1) AS sclr_0 FROM ContainsTexts c0_',
31+
'removes accents with specified dictionary' => "SELECT unaccent('unaccent', c0_.text1) AS sclr_0 FROM ContainsTexts c0_",
3232
];
3333
}
3434

3535
protected function getDqlStatements(): array
3636
{
3737
return [
38-
\sprintf('SELECT UNACCENT(e.text1) FROM %s e', ContainsTexts::class),
39-
\sprintf("SELECT UNACCENT('unaccent', e.text1) FROM %s e", ContainsTexts::class),
38+
'removes accents with default dictionary' => \sprintf('SELECT UNACCENT(e.text1) FROM %s e', ContainsTexts::class),
39+
'removes accents with specified dictionary' => \sprintf("SELECT UNACCENT('unaccent', e.text1) FROM %s e", ContainsTexts::class),
4040
];
4141
}
4242

0 commit comments

Comments
 (0)