From d0fa6f7e03db01f316b82be105058124571ef63f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 1 Feb 2022 19:44:14 +0100 Subject: [PATCH] Added missing test covering URL validation with valid URL but title resolutio is disabled --- module/Core/test/Util/UrlValidatorTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/Core/test/Util/UrlValidatorTest.php b/module/Core/test/Util/UrlValidatorTest.php index 51729743..55cb4d86 100644 --- a/module/Core/test/Util/UrlValidatorTest.php +++ b/module/Core/test/Util/UrlValidatorTest.php @@ -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 {