2021-05-22 02:34:42 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioTest\Shlink\Core\Crawling;
|
|
|
|
|
2022-10-21 11:49:47 -05:00
|
|
|
use PHPUnit\Framework\MockObject\MockObject;
|
2021-05-22 02:34:42 -05:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use Shlinkio\Shlink\Core\Crawling\CrawlingHelper;
|
2022-12-14 07:38:22 -06:00
|
|
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\CrawlableShortCodesQueryInterface;
|
2021-05-22 02:34:42 -05:00
|
|
|
|
|
|
|
class CrawlingHelperTest extends TestCase
|
|
|
|
{
|
|
|
|
private CrawlingHelper $helper;
|
2022-12-14 07:38:22 -06:00
|
|
|
private MockObject & CrawlableShortCodesQueryInterface $query;
|
2021-05-22 02:34:42 -05:00
|
|
|
|
|
|
|
protected function setUp(): void
|
|
|
|
{
|
2022-12-14 07:38:22 -06:00
|
|
|
$this->query = $this->createMock(CrawlableShortCodesQueryInterface::class);
|
|
|
|
$this->helper = new CrawlingHelper($this->query);
|
2021-05-22 02:34:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @test */
|
|
|
|
public function listCrawlableShortCodesDelegatesIntoRepository(): void
|
|
|
|
{
|
2022-12-14 07:38:22 -06:00
|
|
|
$this->query->expects($this->once())->method('__invoke')->willReturn([]);
|
|
|
|
[...$this->helper->listCrawlableShortCodes()];
|
2021-05-22 02:34:42 -05:00
|
|
|
}
|
|
|
|
}
|