mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 22:48:27 +03:00
29 lines
870 B
PHP
29 lines
870 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ShlinkioTest\Shlink\Core\Crawling;
|
|
|
|
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()];
|
|
}
|
|
}
|