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 49f2be7 commit ce248b3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testGetSourceReturnsContentFrom3rdPartyAndConvertsBundleNameToPa
protected function getFilesystemLoaderForSplitBundleConverterTest(): TwigFilesystemLoader
{
$mockBuilder = $this->getMockBuilder(TwigFilesystemLoader::class)
->setMethods(['isPathInSplit'])
->onlyMethods(['isPathInSplit'])
->setConstructorArgs([[static::PATH_TO_CORE], $this->getCacheStub(), $this->getTemplateNameExtractor()]);

$mock = $mockBuilder->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testGetSourceReturnsContentFrom3rdPartyAndConvertsBundleNameToPa
protected function getFilesystemLoaderForSplitBundleConverterTest(): TwigFilesystemLoader
{
$mockBuilder = $this->getMockBuilder(TwigFilesystemLoader::class)
->setMethods(['isPathInSplit'])
->onlyMethods(['isPathInSplit'])
->setConstructorArgs([[static::PATH_TO_CORE], $this->getCacheStub(), $this->getTemplateNameExtractor()]);

$mock = $mockBuilder->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testWarmUpCallsAllAppliedCacheWarmer(): void
private function getCacheWarmerMock(): CacheWarmerInterface
{
$mockBuilder = $this->getMockBuilder(CacheWarmerInterface::class)
->setMethods(['warmUp']);
->onlyMethods(['warmUp']);

return $mockBuilder->getMock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testWarmUpCallsTemplatePathMapBuilderAndCacheWriter(): void
protected function getCacheWriterMock(): CacheWriterInterface
{
$mockBuilder = $this->getMockBuilder(CacheWriterInterface::class)
->setMethods(['write']);
->onlyMethods(['write']);

return $mockBuilder->getMock();
}
Expand All @@ -70,7 +70,7 @@ protected function getCacheWriterMock(): CacheWriterInterface
protected function getTemplatePathMapBuilderMock(): TemplatePathMapBuilderInterface
{
$mockBuilder = $this->getMockBuilder(TemplatePathMapBuilderInterface::class)
->setMethods(['build']);
->onlyMethods(['build']);

return $mockBuilder->getMock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testBuildReturnsArray(): void
protected function getTemplateNameBuilderMock(): TemplateNameBuilderInterface
{
$mockBuilder = $this->getMockBuilder(TemplateNameBuilderInterface::class)
->setMethods(['buildTemplateName']);
->onlyMethods(['buildTemplateName']);

return $mockBuilder->getMock();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SprykerTest/Zed/Twig/Business/TwigFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testWarmUpCacheDelegatesToCacheWarmerModel(): void
protected function getFactoryMock(): TwigBusinessFactory
{
$mockBuilder = $this->getMockBuilder(TwigBusinessFactory::class)
->setMethods(['createCacheWarmer']);
->onlyMethods(['createCacheWarmer']);

$mock = $mockBuilder->getMock();
$mock->expects($this->once())->method('createCacheWarmer')->willReturn($this->getCacheWarmerMock());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testCommandIsExecutable(): void
protected function getCacheWarmerConsoleMock(): CacheWarmerConsole
{
$mockBuilder = $this->getMockBuilder(CacheWarmerConsole::class)
->setMethods(['getFacade']);
->onlyMethods(['getFacade']);

$mock = $mockBuilder->getMock();
$mock->expects($this->once())->method('getFacade')->willReturn($this->getFacadeMock());
Expand Down

0 comments on commit ce248b3

Please sign in to comment.