Added missing test covering URL validation with valid URL but title resolutio is disabled

This commit is contained in:
Alejandro Celaya 2022-02-01 19:44:14 +01:00
parent d29c58dce5
commit d0fa6f7e03

View file

@ -104,6 +104,18 @@ class UrlValidatorTest extends TestCase
$request->shouldNotHaveBeenCalled();
}
/** @test */
public function validateUrlWithTitleReturnsNullWhenAutoResolutionIsDisabledAndValidationIsEnabled(): void
{
$request = $this->httpClient->request(Argument::cetera())->willReturn($this->respWithTitle());
$this->options->autoResolveTitles = false;
$result = $this->urlValidator->validateUrlWithTitle('http://foobar.com/12345/hello?foo=bar', true);
self::assertNull($result);
$request->shouldHaveBeenCalledOnce();
}
/** @test */
public function validateUrlWithTitleResolvesTitleWhenAutoResolutionIsEnabled(): void
{