File tree 2 files changed +34
-3
lines changed
2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ jobs:
372
372
mysql-version :
373
373
- " 5.7"
374
374
- " 8.0"
375
- - " 9.0 "
375
+ - " 9.1 "
376
376
extension :
377
377
- " mysqli"
378
378
- " pdo_mysql"
@@ -401,10 +401,10 @@ jobs:
401
401
custom-entrypoint : >-
402
402
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
403
403
- php-version : " 8.4"
404
- mysql-version : " 9.0 "
404
+ mysql-version : " 9.1 "
405
405
extension : " mysqli"
406
406
- php-version : " 8.4"
407
- mysql-version : " 9.0 "
407
+ mysql-version : " 9.1 "
408
408
extension : " pdo_mysql"
409
409
410
410
services :
Original file line number Diff line number Diff line change 25
25
use PHPUnit \Framework \TestCase ;
26
26
use Psr \Cache \CacheItemInterface ;
27
27
use Psr \Cache \CacheItemPoolInterface ;
28
+ use RuntimeException ;
28
29
29
30
/** @psalm-import-type Params from DriverManager */
30
31
#[RequiresPhpExtension('pdo_mysql ' )]
@@ -172,6 +173,36 @@ public function testCommitStartsTransactionInNoAutoCommitMode(): void
172
173
self ::assertTrue ($ conn ->isTransactionActive ());
173
174
}
174
175
176
+ public function testBeginTransactionFailureAfterCommitInNoAutoCommitMode (): void
177
+ {
178
+ $ driverConnectionMock = $ this ->createMock (DriverConnection::class);
179
+ $ driverConnectionMock ->expects (self ::exactly (2 ))
180
+ ->method ('beginTransaction ' )
181
+ ->willReturnOnConsecutiveCalls (
182
+ true ,
183
+ self ::throwException (new RuntimeException ()),
184
+ );
185
+
186
+ $ driver = self ::createStub (Driver::class);
187
+ $ driver
188
+ ->method ('connect ' )
189
+ ->willReturn (
190
+ $ driverConnectionMock ,
191
+ );
192
+ $ conn = new Connection ([], $ driver );
193
+
194
+ $ conn ->setAutoCommit (false );
195
+
196
+ /** Invoke protected {@see Connection::connect()} */
197
+ $ conn ->getServerVersion ();
198
+ try {
199
+ $ conn ->commit ();
200
+ } catch (RuntimeException ) {
201
+ }
202
+
203
+ self ::assertTrue ($ conn ->isTransactionActive ());
204
+ }
205
+
175
206
/** @return bool[][] */
176
207
public static function resultProvider (): array
177
208
{
You can’t perform that action at this time.
0 commit comments