chore: apply Scruintizer diff

This commit is contained in:
rugk 2025-09-03 14:11:35 +00:00
parent 4f13d93af2
commit 168fed64b9

View file

@ -57,16 +57,17 @@ class YourlsProxyTest extends TestCase
$this->assertEquals($yourls->getError(), 'Invalid URL given.'); $this->assertEquals($yourls->getError(), 'Invalid URL given.');
} }
public function providerInvalidUrl(): array { public function providerInvalidUrl(): array
return [ {
[''], return array(
[' '], array(''),
['foo'], array(' '),
['https://'], array('foo'),
['https://example.com'], // missing path and query parameter, array('https://'),
['https://example.com/'], // missing query parameter array('https://example.com'), // missing path and query parameter,
['https://example.com?paste=something'] // missing path parameter array('https://example.com/'), // missing query parameter
]; array('https://example.com?paste=something'), // missing path parameter
);
} }
/** /**
@ -92,12 +93,13 @@ class YourlsProxyTest extends TestCase
$this->assertEquals($yourls->getError(), 'Trying to shorten a URL that isn\'t pointing at our instance.'); $this->assertEquals($yourls->getError(), 'Trying to shorten a URL that isn\'t pointing at our instance.');
} }
public function providerForeignUrl(): array { public function providerForeignUrl(): array
return [ {
['ftp://example.com/?n=np'], // wrong protocol return array(
['https://other.example.com/?foo#bar'], // wrong domain array('ftp://example.com/?n=np'), // wrong protocol
['https://other.example.com/?q=https://example.com/?foo#bar'] // domain included inside string array('https://other.example.com/?foo#bar'), // wrong domain
]; array('https://other.example.com/?q=https://example.com/?foo#bar'), // domain included inside string
);
} }
public function testYourlsError() public function testYourlsError()