Skip to content

Commit

Permalink
Merge branch '3.9.x' into 4.2.x
Browse files Browse the repository at this point in the history
* 3.9.x:
  Create stubs instead of mocks (doctrine#6564)
  test: remove ->expects(self::any())
  Fix typo in PostgreSql documentation reference
  • Loading branch information
derrabus committed Oct 21, 2024
2 parents 8f60369 + b87a89f commit e729f88
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/en/reference/schema-representation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ and absolutely not portable.
- **engine** (string): The DB engine used for the table. Currently only supported on MySQL.

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

Column
~~~~~~
Expand Down
22 changes: 11 additions & 11 deletions tests/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ protected function setUp(): void

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

return $this->getMockBuilder(Connection::class)
->onlyMethods(['executeStatement'])
->setConstructorArgs([[], $driverMock])
->setConstructorArgs([[], $driver])
->getMock();
}

Expand Down Expand Up @@ -146,9 +146,9 @@ public function testSetAutoCommit(): void

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

$conn = new Connection([], $driverMock);
$conn = new Connection([], $driver);

$conn->setAutoCommit(false);

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

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

$conn = new Connection([], $driverMock);
$conn = new Connection([], $driver);

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

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

$conn = new Connection([], $driverMock);
$conn = new Connection([], $driver);

$conn->setAutoCommit(false);
$conn->executeQuery('SELECT 1');
Expand All @@ -198,12 +198,12 @@ public function testSwitchingAutoCommitModeCommitsAllCurrentTransactions(): void
->method('supportsSavepoints')
->willReturn(true);

$driverMock = $this->createMock(Driver::class);
$driverMock
$driver = self::createStub(Driver::class);
$driver
->method('getDatabasePlatform')
->willReturn($platform);

$conn = new Connection([], $driverMock);
$conn = new Connection([], $driver);

$conn->beginTransaction();
$conn->beginTransaction();
Expand Down
4 changes: 2 additions & 2 deletions tests/Query/Expression/ExpressionBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class ExpressionBuilderTest extends TestCase

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

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

$conn->expects(self::any())
$conn
->method('createExpressionBuilder')
->willReturn($this->expr);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Types/DateImmutableTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testConvertsDateStringToPHPValue(): void

public function testResetTimeFractionsWhenConvertingToPHPValue(): void
{
$this->platform->expects(self::any())
$this->platform
->method('getDateFormatString')
->willReturn('Y-m-d');

Expand Down
2 changes: 1 addition & 1 deletion tests/Types/DateTimeImmutableTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testConvertsDateTimeStringToPHPValue(): void

public function testConvertsDateTimeStringWithMicrosecondsToPHPValue(): void
{
$this->platform->expects(self::any())
$this->platform
->method('getDateTimeFormatString')
->willReturn('Y-m-d H:i:s');

Expand Down
2 changes: 1 addition & 1 deletion tests/Types/TimeImmutableTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testConvertsTimeStringToPHPValue(): void

public function testResetDateFractionsWhenConvertingToPHPValue(): void
{
$this->platform->expects(self::any())
$this->platform
->method('getTimeFormatString')
->willReturn('H:i:s');

Expand Down

0 comments on commit e729f88

Please sign in to comment.