Skip to content

Commit

Permalink
FRW-8773 Added PHPUnit 11 support. (#11131)
Browse files Browse the repository at this point in the history
FRW-8773 Added PHP Unit 11 support.
  • Loading branch information
olhalivitchuk authored Nov 4, 2024
1 parent 342d2d9 commit aa178e6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function getPostgreSqlDatabaseCreatorMock(array $methods = []): Postgr
{
return $this->getMockBuilder(PostgreSqlDatabaseCreator::class)
->disableOriginalConstructor()
->setMethods($methods)
->onlyMethods($methods)
->getMock();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/SprykerTest/Zed/Propel/Business/PropelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa178e6

Please sign in to comment.