Skip to content

Commit

Permalink
Simplify mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire authored and OskarStark committed Jan 28, 2020
1 parent 369d85c commit c7a4c0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/Block/AdminListBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function setUp(): void
{
parent::setUp();

$this->pool = $this->getMockBuilder(Pool::class)->disableOriginalConstructor()->getMock();
$this->pool = $this->createMock(Pool::class);

$this->templateRegistry = $this->prophesize(TemplateRegistryInterface::class);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Block/AdminSearchBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ protected function setUp(): void
{
parent::setUp();

$this->pool = $this->getMockBuilder(Pool::class)->disableOriginalConstructor()->getMock();
$this->searchHandler = $this->getMockBuilder(SearchHandler::class)->disableOriginalConstructor()->getMock();
$this->pool = $this->createMock(Pool::class);
$this->searchHandler = $this->createMock(SearchHandler::class);
}

public function testDefaultSettings(): void
Expand All @@ -65,7 +65,7 @@ public function testDefaultSettings(): void

public function testGlobalSearchReturnsEmptyWhenFiltersAreDisabled(): void
{
$admin = $this->getMockBuilder(AbstractAdmin::class)->disableOriginalConstructor()->getMock();
$admin = $this->createMock(AbstractAdmin::class);

$blockService = new AdminSearchBlockService(
$this->createMock(Environment::class),
Expand Down
2 changes: 1 addition & 1 deletion tests/Block/AdminStatsBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
{
parent::setUp();

$this->pool = $this->getMockBuilder(Pool::class)->disableOriginalConstructor()->getMock();
$this->pool = $this->createMock(Pool::class);
}

public function testDefaultSettings(): void
Expand Down

0 comments on commit c7a4c0b

Please sign in to comment.