mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-03 17:49:19 +02:00
chore: apply Scruintizer diff
This commit is contained in:
parent
4f13d93af2
commit
168fed64b9
1 changed files with 18 additions and 16 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue