Skip to content

Commit e729f88

Browse files
committed
Merge branch '3.9.x' into 4.2.x
* 3.9.x: Create stubs instead of mocks (#6564) test: remove ->expects(self::any()) Fix typo in PostgreSql documentation reference
2 parents 8f60369 + b87a89f commit e729f88

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

docs/en/reference/schema-representation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ and absolutely not portable.
9393
- **engine** (string): The DB engine used for the table. Currently only supported on MySQL.
9494

9595
- **unlogged** (boolean): Set a PostgreSQL table type as
96-
`unlogged <https://www.postgresql.org/docs/current/sql-createtable.htmll>`_
96+
`unlogged <https://www.postgresql.org/docs/current/sql-createtable.html>`_
9797

9898
Column
9999
~~~~~~

tests/ConnectionTest.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ protected function setUp(): void
4747

4848
private function getExecuteStatementMockConnection(): Connection&MockObject
4949
{
50-
$driverMock = $this->createMock(Driver::class);
50+
$driver = self::createStub(Driver::class);
5151

5252
return $this->getMockBuilder(Connection::class)
5353
->onlyMethods(['executeStatement'])
54-
->setConstructorArgs([[], $driverMock])
54+
->setConstructorArgs([[], $driver])
5555
->getMock();
5656
}
5757

@@ -146,9 +146,9 @@ public function testSetAutoCommit(): void
146146

147147
public function testConnectStartsTransactionInNoAutoCommitMode(): void
148148
{
149-
$driverMock = $this->createMock(Driver::class);
149+
$driver = self::createStub(Driver::class);
150150

151-
$conn = new Connection([], $driverMock);
151+
$conn = new Connection([], $driver);
152152

153153
$conn->setAutoCommit(false);
154154

@@ -161,9 +161,9 @@ public function testConnectStartsTransactionInNoAutoCommitMode(): void
161161

162162
public function testCommitStartsTransactionInNoAutoCommitMode(): void
163163
{
164-
$driverMock = $this->createMock(Driver::class);
164+
$driver = self::createStub(Driver::class);
165165

166-
$conn = new Connection([], $driverMock);
166+
$conn = new Connection([], $driver);
167167

168168
$conn->setAutoCommit(false);
169169
$conn->executeQuery('SELECT 1');
@@ -180,9 +180,9 @@ public static function resultProvider(): array
180180

181181
public function testRollBackStartsTransactionInNoAutoCommitMode(): void
182182
{
183-
$driverMock = $this->createMock(Driver::class);
183+
$driver = self::createStub(Driver::class);
184184

185-
$conn = new Connection([], $driverMock);
185+
$conn = new Connection([], $driver);
186186

187187
$conn->setAutoCommit(false);
188188
$conn->executeQuery('SELECT 1');
@@ -198,12 +198,12 @@ public function testSwitchingAutoCommitModeCommitsAllCurrentTransactions(): void
198198
->method('supportsSavepoints')
199199
->willReturn(true);
200200

201-
$driverMock = $this->createMock(Driver::class);
202-
$driverMock
201+
$driver = self::createStub(Driver::class);
202+
$driver
203203
->method('getDatabasePlatform')
204204
->willReturn($platform);
205205

206-
$conn = new Connection([], $driverMock);
206+
$conn = new Connection([], $driver);
207207

208208
$conn->beginTransaction();
209209
$conn->beginTransaction();

tests/Query/Expression/ExpressionBuilderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class ExpressionBuilderTest extends TestCase
1616

1717
protected function setUp(): void
1818
{
19-
$conn = $this->createMock(Connection::class);
19+
$conn = self::createStub(Connection::class);
2020

2121
$this->expr = new ExpressionBuilder($conn);
2222

23-
$conn->expects(self::any())
23+
$conn
2424
->method('createExpressionBuilder')
2525
->willReturn($this->expr);
2626
}

tests/Types/DateImmutableTypeTest.php

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

9191
public function testResetTimeFractionsWhenConvertingToPHPValue(): void
9292
{
93-
$this->platform->expects(self::any())
93+
$this->platform
9494
->method('getDateFormatString')
9595
->willReturn('Y-m-d');
9696

tests/Types/DateTimeImmutableTypeTest.php

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

9191
public function testConvertsDateTimeStringWithMicrosecondsToPHPValue(): void
9292
{
93-
$this->platform->expects(self::any())
93+
$this->platform
9494
->method('getDateTimeFormatString')
9595
->willReturn('Y-m-d H:i:s');
9696

tests/Types/TimeImmutableTypeTest.php

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

9191
public function testResetDateFractionsWhenConvertingToPHPValue(): void
9292
{
93-
$this->platform->expects(self::any())
93+
$this->platform
9494
->method('getTimeFormatString')
9595
->willReturn('H:i:s');
9696

0 commit comments

Comments
 (0)