16 lines
473 B
PHP
16 lines
473 B
PHP
<?php declare(strict_types=1);
|
|
|
|
use Lewisdale\Webmentions\Endpoint;
|
|
use PHPUnit\Framework\TestCase;
|
|
use PHPUnit\Framework\Attributes\TestWith;
|
|
|
|
class EndpointTest extends TestCase {
|
|
#[TestWith(["https://my.url.com", true])]
|
|
#[TestWith(["my.url.com", false])]
|
|
public function testValidatesUrls(string $url, bool $expected)
|
|
{
|
|
$endpoint = new Endpoint();
|
|
$this->assertEquals($expected, $endpoint->validateUrl($url), "Expected $url");
|
|
}
|
|
}
|
|
?>
|