Added stricter types for mocks

This commit is contained in:
Alejandro Celaya
2022-10-24 19:53:13 +02:00
parent aeafb244d9
commit 51f243995a
87 changed files with 156 additions and 152 deletions

View File

@@ -15,7 +15,7 @@ use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
use Shlinkio\Shlink\Core\ShortUrl\UrlShortener;
use Shlinkio\Shlink\Core\ShortUrl\UrlShortenerInterface;
use ShlinkioTest\Shlink\CLI\CliTestUtilsTrait;
use Symfony\Component\Console\Tester\CommandTester;
@@ -26,12 +26,12 @@ class CreateShortUrlCommandTest extends TestCase
private const DEFAULT_DOMAIN = 'default.com';
private CommandTester $commandTester;
private MockObject $urlShortener;
private MockObject $stringifier;
private MockObject & UrlShortenerInterface $urlShortener;
private MockObject & ShortUrlStringifierInterface $stringifier;
protected function setUp(): void
{
$this->urlShortener = $this->createMock(UrlShortener::class);
$this->urlShortener = $this->createMock(UrlShortenerInterface::class);
$this->stringifier = $this->createMock(ShortUrlStringifierInterface::class);
$command = new CreateShortUrlCommand(