mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-29 20:14:15 -06:00
31 lines
904 B
PHP
31 lines
904 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ShlinkioTest\Shlink\Core\Crawling;
|
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use PHPUnit\Framework\MockObject\MockObject;
|
|
use PHPUnit\Framework\TestCase;
|
|
use Shlinkio\Shlink\Core\Crawling\CrawlingHelper;
|
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\CrawlableShortCodesQueryInterface;
|
|
|
|
class CrawlingHelperTest extends TestCase
|
|
{
|
|
private CrawlingHelper $helper;
|
|
private MockObject & CrawlableShortCodesQueryInterface $query;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
$this->query = $this->createMock(CrawlableShortCodesQueryInterface::class);
|
|
$this->helper = new CrawlingHelper($this->query);
|
|
}
|
|
|
|
#[Test]
|
|
public function listCrawlableShortCodesDelegatesIntoRepository(): void
|
|
{
|
|
$this->query->expects($this->once())->method('__invoke')->willReturn([]);
|
|
[...$this->helper->listCrawlableShortCodes()];
|
|
}
|
|
}
|