Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc01681

Browse files
Fix test
1 parent abf769b commit dc01681

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Symfony/Component/Lock/Tests/Store/DoctrineDbalStoreTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ public function testTableCreationInTransactionNotSupported()
154154
$conn->expects($this->atLeast(2))
155155
->method('executeStatement')
156156
->willReturnCallback(function ($sql) use (&$series) {
157-
[$constraint, $return] = array_shift($series);
158-
$constraint->evaluate($sql);
157+
if ([$constraint, $return] = array_shift($series)) {
158+
$constraint->evaluate($sql);
159+
}
159160

160161
if ($return instanceof \Exception) {
161162
throw $return;
162163
}
163164

164-
return $return;
165+
return $return ?? 1;
165166
})
166167
;
167168

@@ -195,14 +196,15 @@ public function testCreatesTableOutsideTransaction()
195196
$conn->expects($this->atLeast(3))
196197
->method('executeStatement')
197198
->willReturnCallback(function ($sql) use (&$series) {
198-
[$constraint, $return] = array_shift($series);
199-
$constraint->evaluate($sql);
199+
if ([$constraint, $return] = array_shift($series)) {
200+
$constraint->evaluate($sql);
201+
}
200202

201203
if ($return instanceof \Exception) {
202204
throw $return;
203205
}
204206

205-
return $return;
207+
return $return ?? 1;
206208
})
207209
;
208210

0 commit comments

Comments
 (0)