Skip to content

Commit cada3aa

Browse files
[Bridge/Doctrine] fix review
1 parent 330c22b commit cada3aa

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ public function getEntitiesByIds($identifier, array $values)
8989
return $qb->andWhere($where)
9090
->getQuery()
9191
->setParameter($parameter, $values, $parameterType)
92-
->getResult() ?: [];
92+
->getResult();
9393
}
9494
}

Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ protected function checkIdentifierType($classname, $expectedType)
3737
->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute'])
3838
->getMock();
3939

40+
$query
41+
->method('getResult')
42+
->willReturn([]);
43+
4044
$query->expects($this->once())
4145
->method('setParameter')
4246
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', [1, 2], $expectedType)
@@ -66,6 +70,10 @@ public function testFilterNonIntegerValues()
6670
->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute'])
6771
->getMock();
6872

73+
$query
74+
->method('getResult')
75+
->willReturn([]);
76+
6977
$query->expects($this->once())
7078
->method('setParameter')
7179
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', [1, 2, 3, '9223372036854775808'], Connection::PARAM_INT_ARRAY)
@@ -98,6 +106,10 @@ public function testFilterEmptyUuids($entityClass)
98106
->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute'])
99107
->getMock();
100108

109+
$query
110+
->method('getResult')
111+
->willReturn([]);
112+
101113
$query->expects($this->once())
102114
->method('setParameter')
103115
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', ['71c5fd46-3f16-4abb-bad7-90ac1e654a2d', 'b98e8e11-2897-44df-ad24-d2627eb7f499'], Connection::PARAM_STR_ARRAY)
@@ -133,6 +145,10 @@ public function testEmbeddedIdentifierName()
133145
->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute'])
134146
->getMock();
135147

148+
$query
149+
->method('getResult')
150+
->willReturn([]);
151+
136152
$query->expects($this->once())
137153
->method('setParameter')
138154
->with('ORMQueryBuilderLoader_getEntitiesByIds_id_value', [1, 2, 3], Connection::PARAM_INT_ARRAY)

0 commit comments

Comments
 (0)