Move URL into separate file, handle source URL validation for sending webmentions

This commit is contained in:
Lewis Dale committed 2023-03-17 10:19:50 +00:00
1 parent fca08de828
commit ec83d67bde
8 files changed
+125 -60

No files matched your search

+1 -9
View File
@@ -48,15 +48,7 @@ class EndpointTest extends TestCase
$endpoint = new Endpoint($this->mockClient, $this->mockGateway);
$endpoint->receiveWebmention($source, $target);
}
#[TestWith(["https://my.url.com", true])]
#[TestWith(["my.url.com", false])]
public function testValidatesUrls(string $url, bool $expected)
{
$endpoint = new Endpoint($this->mockClient, $this->mockGateway);
$this->assertEquals($expected, $endpoint->validateUrl($url), "Expected $url");
}
#[TestWith(["https://my-valid-source.url", "htt://my-invalid-target.com"])]
#[TestWith(["my-invalid-source", "https://my-valid-target.com"])]
#[TestWith(["http:///an-invalid-source", "an-invalid-target"])]