Skip to content

Commit 9fca0ee

Browse files
authored
Merge pull request #6558 from simPod/expect-any
test: remove ->expects(self::any())
2 parents dcf8c2d + eeb2e5c commit 9fca0ee

8 files changed

+21
-21
lines changed

tests/ConnectionTest.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private function getExecuteStatementMockConnection(): Connection
5959
{
6060
$driverMock = $this->createMock(Driver::class);
6161

62-
$driverMock->expects(self::any())
62+
$driverMock
6363
->method('connect')
6464
->willReturn(
6565
$this->createMock(DriverConnection::class),
@@ -184,7 +184,7 @@ public function testTransactionBeginDispatchEvent(): void
184184
{
185185
$eventManager = new EventManager();
186186
$driverMock = $this->createMock(Driver::class);
187-
$driverMock->expects(self::any())
187+
$driverMock
188188
->method('connect')
189189
->willReturn(
190190
$this->createMock(DriverConnection::class),
@@ -210,7 +210,7 @@ public function testTransactionCommitDispatchEvent(): void
210210
{
211211
$eventManager = new EventManager();
212212
$driverMock = $this->createMock(Driver::class);
213-
$driverMock->expects(self::any())
213+
$driverMock
214214
->method('connect')
215215
->willReturn(
216216
$this->createMock(DriverConnection::class),
@@ -237,7 +237,7 @@ public function testTransactionCommitEventNotCalledAfterRollBack(): void
237237
{
238238
$eventManager = new EventManager();
239239
$driverMock = $this->createMock(Driver::class);
240-
$driverMock->expects(self::any())
240+
$driverMock
241241
->method('connect')
242242
->willReturn(
243243
$this->createMock(DriverConnection::class),
@@ -273,7 +273,7 @@ public function testTransactionRollBackDispatchEvent(): void
273273
{
274274
$eventManager = new EventManager();
275275
$driverMock = $this->createMock(Driver::class);
276-
$driverMock->expects(self::any())
276+
$driverMock
277277
->method('connect')
278278
->willReturn(
279279
$this->createMock(DriverConnection::class),
@@ -307,7 +307,7 @@ public function testEventManagerPassedToPlatform(): void
307307
->with($eventManager);
308308

309309
$driver = $this->createMock(Driver::class);
310-
$driver->expects(self::any())
310+
$driver
311311
->method('getDatabasePlatform')
312312
->willReturn($platform);
313313

@@ -380,7 +380,7 @@ public function testSetAutoCommit(): void
380380
public function testConnectStartsTransactionInNoAutoCommitMode(): void
381381
{
382382
$driverMock = $this->createMock(Driver::class);
383-
$driverMock->expects(self::any())
383+
$driverMock
384384
->method('connect')
385385
->willReturn(
386386
$this->createMock(DriverConnection::class),
@@ -399,7 +399,7 @@ public function testConnectStartsTransactionInNoAutoCommitMode(): void
399399
public function testCommitStartsTransactionInNoAutoCommitMode(): void
400400
{
401401
$driverMock = $this->createMock(Driver::class);
402-
$driverMock->expects(self::any())
402+
$driverMock
403403
->method('connect')
404404
->willReturn(
405405
$this->createMock(DriverConnection::class),
@@ -421,7 +421,7 @@ public function testCommitReturn(bool $expectedResult): void
421421
->method('commit')->willReturn($expectedResult);
422422

423423
$driverMock = $this->createMock(Driver::class);
424-
$driverMock->expects(self::any())
424+
$driverMock
425425
->method('connect')
426426
->willReturn($driverConnection);
427427

@@ -442,7 +442,7 @@ public static function resultProvider(): array
442442
public function testRollBackStartsTransactionInNoAutoCommitMode(): void
443443
{
444444
$driverMock = $this->createMock(Driver::class);
445-
$driverMock->expects(self::any())
445+
$driverMock
446446
->method('connect')
447447
->willReturn(
448448
$this->createMock(DriverConnection::class),
@@ -459,7 +459,7 @@ public function testRollBackStartsTransactionInNoAutoCommitMode(): void
459459
public function testSwitchingAutoCommitModeCommitsAllCurrentTransactions(): void
460460
{
461461
$driverMock = $this->createMock(Driver::class);
462-
$driverMock->expects(self::any())
462+
$driverMock
463463
->method('connect')
464464
->willReturn(
465465
$this->createMock(DriverConnection::class),

tests/Query/Expression/ExpressionBuilderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function setUp(): void
1717

1818
$this->expr = new ExpressionBuilder($conn);
1919

20-
$conn->expects(self::any())
20+
$conn
2121
->method('getExpressionBuilder')
2222
->willReturn($this->expr);
2323
}

tests/Schema/Visitor/DropSchemaSqlCollectorTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ private function getStubKeyConstraint(string $name): ForeignKeyConstraint
4343
{
4444
$constraint = $this->createMock(ForeignKeyConstraint::class);
4545

46-
$constraint->expects(self::any())
46+
$constraint
4747
->method('getName')
4848
->willReturn($name);
4949

50-
$constraint->expects(self::any())
50+
$constraint
5151
->method('getForeignColumns')
5252
->willReturn([]);
5353

54-
$constraint->expects(self::any())
54+
$constraint
5555
->method('getColumns')
5656
->willReturn([]);
5757

tests/StatementTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ protected function setUp(): void
3636
->getMock();
3737

3838
$this->configuration = $this->createMock(Configuration::class);
39-
$this->conn->expects(self::any())
39+
$this->conn
4040
->method('getConfiguration')
4141
->willReturn($this->configuration);
4242

43-
$this->conn->expects(self::any())
43+
$this->conn
4444
->method('getDriver')
4545
->willReturn($driver);
4646
}

tests/Types/DateImmutableTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testConvertsDateStringToPHPValue(): void
9797

9898
public function testResetTimeFractionsWhenConvertingToPHPValue(): void
9999
{
100-
$this->platform->expects(self::any())
100+
$this->platform
101101
->method('getDateFormatString')
102102
->willReturn('Y-m-d');
103103

tests/Types/DateTimeImmutableTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testConvertsDateTimeStringToPHPValue(): void
9898

9999
public function testConvertsDateTimeStringWithMicrosecondsToPHPValue(): void
100100
{
101-
$this->platform->expects(self::any())
101+
$this->platform
102102
->method('getDateTimeFormatString')
103103
->willReturn('Y-m-d H:i:s');
104104

tests/Types/GuidTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testNativeGuidSupport(): void
3535
{
3636
self::assertTrue($this->type->requiresSQLCommentHint($this->platform));
3737

38-
$this->platform->expects(self::any())
38+
$this->platform
3939
->method('hasNativeGuidType')
4040
->willReturn(true);
4141

tests/Types/TimeImmutableTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testConvertsTimeStringToPHPValue(): void
9797

9898
public function testResetDateFractionsWhenConvertingToPHPValue(): void
9999
{
100-
$this->platform->expects(self::any())
100+
$this->platform
101101
->method('getTimeFormatString')
102102
->willReturn('H:i:s');
103103

0 commit comments

Comments
 (0)