Skip to content

Commit

Permalink
use the modern phpunit mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 12, 2024
1 parent f157a0f commit c9cb94f
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Tests/LiipImagineBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testSubClassOfBundle(): void
public function testAddPasses(): void
{
$passes = [];
$containerMock = $this->createContainerBuilderMock();
$containerMock = $this->createMock(ContainerBuilder::class);
$containerMock
->expects($this->atLeastOnce())
->method('getExtension')
Expand Down Expand Up @@ -95,7 +95,7 @@ public function testAddResolvers(): void
return true;
}));

$containerMock = $this->createContainerBuilderMock();
$containerMock = $this->createMock(ContainerBuilder::class);
$containerMock
->expects($this->atLeastOnce())
->method('getExtension')
Expand Down Expand Up @@ -123,7 +123,7 @@ public function testAddLoaders(): void

return true;
}));
$containerMock = $this->createContainerBuilderMock();
$containerMock = $this->createMock(ContainerBuilder::class);
$containerMock
->expects($this->atLeastOnce())
->method('getExtension')
Expand All @@ -140,18 +140,6 @@ public function testAddLoaders(): void
], $loaders);
}

/**
* @return MockObject|ContainerBuilder
*/
protected function createContainerBuilderMock()
{
return $this->createObjectMock(ContainerBuilder::class, [
'getExtension',
'addCompilerPass',
'registerForAutoconfiguration',
], false);
}

/**
* @return MockObject|LiipImagineExtension
*/
Expand Down

0 comments on commit c9cb94f

Please sign in to comment.