Skip to content

Commit 37e4983

Browse files
committed
Tests: fix select('[*]') to select('*') for dbal 5.x identifier escaping
In dbal 5.x, [*] is escaped as a column identifier (`*`) instead of being treated as a wildcard. Use unbracketed * for SELECT wildcards. https://claude.ai/code/session_01VHxTGscLF36vtGBcPXfThi
1 parent 90d31e5 commit 37e4983

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

tests/Cases/ExecutableQueryObject.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestExecutableQueryObject extends ExecutableQueryObject
1616

1717
public function doQuery(QueryBuilder $builder): QueryBuilder
1818
{
19-
return $builder->select('[*]')->from('[test_table]');
19+
return $builder->select('*')->from('[test_table]');
2020
}
2121

2222
}
@@ -53,7 +53,7 @@ test('ExecutableQueryObject builds query via fetch method', function (): void {
5353
$queryBuilder = Mockery::mock(QueryBuilder::class);
5454

5555
$queryBuilder->shouldReceive('select')
56-
->with('[*]')
56+
->with('*')
5757
->once()
5858
->andReturnSelf();
5959

@@ -76,7 +76,7 @@ test('ExecutableQueryObject execute method uses connection', function (): void {
7676
$result = Mockery::mock(Result::class);
7777

7878
$queryBuilder->shouldReceive('select')
79-
->with('[*]')
79+
->with('*')
8080
->once()
8181
->andReturnSelf();
8282

tests/Cases/QueryObject.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('QueryObject builds query via fetch method', function (): void {
1313
$qb = $qo->fetch(new QueryBuilder($platform));
1414

1515
Assert::type(QueryBuilder::class, $qb);
16-
Assert::equal('SELECT [*] FROM [foobar]', $qb->getQuerySql());
16+
Assert::equal('SELECT * FROM [foobar]', $qb->getQuerySql());
1717

1818
Mockery::close();
1919
});

tests/Cases/QueryObjectContextAwareManager.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('QueryObjectContextAwareManager fetch returns Result', function (): void {
5454
$result = Mockery::mock(Result::class);
5555

5656
$queryBuilder->shouldReceive('select')
57-
->with('[*]')
57+
->with('*')
5858
->once()
5959
->andReturnSelf();
6060

tests/Cases/TRepositoryQueryable.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test('TRepositoryQueryable fetch with HYDRATION_RESULTSET returns Result', funct
4848
$result = Mockery::mock(Result::class);
4949

5050
$queryBuilder->shouldReceive('select')
51-
->with('[*]')
51+
->with('*')
5252
->once()
5353
->andReturnSelf();
5454

@@ -92,7 +92,7 @@ test('TRepositoryQueryable fetch with HYDRATION_ENTITY returns ICollection', fun
9292
$collection = new StubCollection();
9393

9494
$queryBuilder->shouldReceive('select')
95-
->with('[*]')
95+
->with('*')
9696
->once()
9797
->andReturnSelf();
9898

@@ -127,7 +127,7 @@ test('TRepositoryQueryable fetch throws InvalidHydrationModeException for invali
127127
$queryBuilder = Mockery::mock(QueryBuilder::class);
128128

129129
$queryBuilder->shouldReceive('select')
130-
->with('[*]')
130+
->with('*')
131131
->once()
132132
->andReturnSelf();
133133

tests/Mocks/Model/Book/AllBooksExecutableQueryObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class AllBooksExecutableQueryObject extends ExecutableQueryObject
1010

1111
public function doQuery(QueryBuilder $builder): QueryBuilder
1212
{
13-
return $builder->select('[*]')->from('[book]', 'b');
13+
return $builder->select('*')->from('[book]', 'b');
1414
}
1515

1616
}

tests/Mocks/Model/Book/AllBooksQueryObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class AllBooksQueryObject extends QueryObject
1010

1111
public function doQuery(QueryBuilder $builder): QueryBuilder
1212
{
13-
return $builder->select('[*]')->from('[book]', 'b');
13+
return $builder->select('*')->from('[book]', 'b');
1414
}
1515

1616
}

tests/Mocks/SimpleQueryObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class SimpleQueryObject extends QueryObject
1010

1111
public function doQuery(QueryBuilder $builder): QueryBuilder
1212
{
13-
return $builder->select('[*]')->from('[foobar]');
13+
return $builder->select('*')->from('[foobar]');
1414
}
1515

1616
}

0 commit comments

Comments
 (0)