Fixed merge conflicts

This commit is contained in:
Alejandro Celaya 2023-02-10 20:44:05 +01:00
commit 245cb0e35d
5 changed files with 35 additions and 3 deletions

View File

@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
* *Nothing* * *Nothing*
### Fixed ### Fixed
* *Nothing* * [#1698](https://github.com/shlinkio/shlink/issues/1698) Fixed error 500 in `robots.txt`.
## [3.5.1] - 2023-02-04 ## [3.5.1] - 2023-02-04

View File

@ -187,7 +187,7 @@ return [
Util\DoctrineBatchHelper::class, Util\DoctrineBatchHelper::class,
], ],
Crawling\CrawlingHelper::class => ['em'], Crawling\CrawlingHelper::class => [ShortUrl\Repository\CrawlableShortCodesQuery::class],
], ],
]; ];

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace ShlinkioApiTest\Shlink\Core\Action;
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
class RobotsTest extends ApiTestCase
{
/** @test */
public function expectedListOfCrawlableShortCodesIsReturned(): void
{
$resp = $this->callShortUrl('robots.txt');
$body = $resp->getBody()->__toString();
self::assertEquals(200, $resp->getStatusCode());
self::assertEquals(
<<<ROBOTS
# For more information about the robots.txt standard, see:
# https://www.robotstxt.org/orig.html
User-agent: *
Allow: /custom
Allow: /abc123
Disallow: /
ROBOTS,
$body,
);
}
}

View File

@ -124,7 +124,7 @@ class ListShortUrlsTest extends ApiTestCase
], ],
'domain' => null, 'domain' => null,
'title' => null, 'title' => null,
'crawlable' => false, 'crawlable' => true,
'forwardQuery' => false, 'forwardQuery' => false,
]; ];
private const SHORT_URL_CUSTOM_DOMAIN = [ private const SHORT_URL_CUSTOM_DOMAIN = [

View File

@ -62,6 +62,7 @@ class ShortUrlsFixture extends AbstractFixture implements DependentFixtureInterf
'maxVisits' => 2, 'maxVisits' => 2,
'apiKey' => $authorApiKey, 'apiKey' => $authorApiKey,
'longUrl' => 'https://shlink.io', 'longUrl' => 'https://shlink.io',
'crawlable' => true,
'forwardQuery' => false, 'forwardQuery' => false,
])), '2019-01-01 00:00:20'); ])), '2019-01-01 00:00:20');
$manager->persist($customShortUrl); $manager->persist($customShortUrl);