diff --git a/module/Core/test/Tag/Paginator/Adapter/TagsInfoPaginatorAdapterTest.php b/module/Core/test/Tag/Paginator/Adapter/TagsInfoPaginatorAdapterTest.php index f2f573a4..99ebddf1 100644 --- a/module/Core/test/Tag/Paginator/Adapter/TagsInfoPaginatorAdapterTest.php +++ b/module/Core/test/Tag/Paginator/Adapter/TagsInfoPaginatorAdapterTest.php @@ -4,45 +4,37 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\Tag\Paginator\Adapter; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Prophecy\Argument; -use Prophecy\PhpUnit\ProphecyTrait; -use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Tag\Model\TagsParams; use Shlinkio\Shlink\Core\Tag\Paginator\Adapter\TagsInfoPaginatorAdapter; use Shlinkio\Shlink\Core\Tag\Repository\TagRepositoryInterface; class TagsInfoPaginatorAdapterTest extends TestCase { - use ProphecyTrait; - private TagsInfoPaginatorAdapter $adapter; - private ObjectProphecy $repo; + private MockObject $repo; protected function setUp(): void { - $this->repo = $this->prophesize(TagRepositoryInterface::class); - $this->adapter = new TagsInfoPaginatorAdapter($this->repo->reveal(), TagsParams::fromRawData([]), null); + $this->repo = $this->createMock(TagRepositoryInterface::class); + $this->adapter = new TagsInfoPaginatorAdapter($this->repo, TagsParams::fromRawData([]), null); } /** @test */ public function getSliceIsDelegatedToRepository(): void { - $findTags = $this->repo->findTagsWithInfo(Argument::cetera())->willReturn([]); - + $this->repo->expects($this->once())->method('findTagsWithInfo')->willReturn([]); $this->adapter->getSlice(1, 1); - - $findTags->shouldHaveBeenCalledOnce(); } /** @test */ public function getNbResultsIsDelegatedToRepository(): void { - $match = $this->repo->matchSingleScalarResult(Argument::cetera())->willReturn(3); + $this->repo->expects($this->once())->method('matchSingleScalarResult')->willReturn(3); $result = $this->adapter->getNbResults(); self::assertEquals(3, $result); - $match->shouldHaveBeenCalledOnce(); } }