From aa178e6d0aff958bc2a1b8b810f74eda3c31ef06 Mon Sep 17 00:00:00 2001 From: Olha Livitchuk <77281282+olhalivitchuk@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:07:47 +0100 Subject: [PATCH] FRW-8773 Added PHPUnit 11 support. (#11131) FRW-8773 Added PHP Unit 11 support. --- .../Propel/Business/Model/PropelConfigConverterJsonTest.php | 2 +- .../Model/PropelDatabase/DatabaseCreatorCollectionTest.php | 2 +- .../Model/PropelDatabase/PostgreSqlDatabaseCreatorTest.php | 2 +- .../Zed/Propel/Business/Model/PropelDatabaseTest.php | 4 ++-- tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/SprykerTest/Zed/Propel/Business/Model/PropelConfigConverterJsonTest.php b/tests/SprykerTest/Zed/Propel/Business/Model/PropelConfigConverterJsonTest.php index de87ff7f..36dee847 100644 --- a/tests/SprykerTest/Zed/Propel/Business/Model/PropelConfigConverterJsonTest.php +++ b/tests/SprykerTest/Zed/Propel/Business/Model/PropelConfigConverterJsonTest.php @@ -142,7 +142,7 @@ public function testConvertConfigThrowsExceptionIfFileNotCreated(): void protected function getPropelConfigConvertJsonMock(): PropelConfigConverterInterface { $propelConfigConverterJsonMock = $this->getMockBuilder(PropelConfigConverterJson::class) - ->setMethods(['writeToFile']) + ->onlyMethods(['writeToFile']) ->setConstructorArgs([$this->getTestConfiguration()]) ->getMock(); diff --git a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/DatabaseCreatorCollectionTest.php b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/DatabaseCreatorCollectionTest.php index 2c73f967..e07ce3c2 100644 --- a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/DatabaseCreatorCollectionTest.php +++ b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/DatabaseCreatorCollectionTest.php @@ -82,7 +82,7 @@ public function testGet(): void */ private function getDatabaseCreatorMock(): DatabaseCreatorInterface { - $databaseCreatorMock = $this->getMockBuilder(DatabaseCreatorInterface::class)->setMethods(['getEngine', 'createIfNotExists'])->getMock(); + $databaseCreatorMock = $this->getMockBuilder(DatabaseCreatorInterface::class)->onlyMethods(['getEngine', 'createIfNotExists'])->getMock(); $databaseCreatorMock->expects($this->once())->method('getEngine')->willReturn(static::TEST_ENGINE); return $databaseCreatorMock; diff --git a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/PostgreSqlDatabaseCreatorTest.php b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/PostgreSqlDatabaseCreatorTest.php index 44e6fdec..3d29f46b 100644 --- a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/PostgreSqlDatabaseCreatorTest.php +++ b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabase/PostgreSqlDatabaseCreatorTest.php @@ -70,7 +70,7 @@ protected function getPostgreSqlDatabaseCreatorMock(array $methods = []): Postgr { return $this->getMockBuilder(PostgreSqlDatabaseCreator::class) ->disableOriginalConstructor() - ->setMethods($methods) + ->onlyMethods($methods) ->getMock(); } diff --git a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabaseTest.php b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabaseTest.php index e255c969..313969e9 100644 --- a/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabaseTest.php +++ b/tests/SprykerTest/Zed/Propel/Business/Model/PropelDatabaseTest.php @@ -41,10 +41,10 @@ public function testInitialization(): void */ public function testCreateIfNotExists(): void { - $databaseCreatorMock = $this->getMockBuilder(DatabaseCreatorInterface::class)->setMethods(['createIfNotExists', 'getEngine'])->getMock(); + $databaseCreatorMock = $this->getMockBuilder(DatabaseCreatorInterface::class)->onlyMethods(['createIfNotExists', 'getEngine'])->getMock(); $databaseCreatorMock->expects($this->once())->method('createIfNotExists'); - $databaseCreatorCollectionMock = $this->getMockBuilder(DatabaseCreatorCollectionInterface::class)->setMethods(['has', 'get', 'add'])->getMock(); + $databaseCreatorCollectionMock = $this->getMockBuilder(DatabaseCreatorCollectionInterface::class)->onlyMethods(['has', 'get', 'add'])->getMock(); $databaseCreatorCollectionMock->expects($this->once())->method('has')->willReturn(true); $databaseCreatorCollectionMock->expects($this->once())->method('get')->willReturn($databaseCreatorMock); diff --git a/tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php b/tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php index 910baae7..b4386ac8 100644 --- a/tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php +++ b/tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php @@ -104,7 +104,7 @@ public function testGetCurrentDatabaseEngineNameThrowsException(): void */ protected function getPropelConfigMock(): PropelConfig { - $propelConfigMock = $this->getMockBuilder(PropelConfig::class)->setMethods(['getCurrentDatabaseEngine'])->getMock(); + $propelConfigMock = $this->getMockBuilder(PropelConfig::class)->onlyMethods(['getCurrentDatabaseEngine'])->getMock(); $propelConfigMock->expects($this->once())->method('getCurrentDatabaseEngine')->willReturn('Un supported database engine'); return $propelConfigMock;