mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-04 01:59:18 +02:00
style: use explicit types
This commit is contained in:
parent
f76704a88c
commit
4f13d93af2
1 changed files with 5 additions and 5 deletions
|
@ -50,14 +50,14 @@ class YourlsProxyTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerInvalidUrl
|
* @dataProvider providerInvalidUrl
|
||||||
*/
|
*/
|
||||||
public function testImvalidUrl($url)
|
public function testImvalidUrl($url): void
|
||||||
{
|
{
|
||||||
$yourls = new YourlsProxy($this->_conf, $url);
|
$yourls = new YourlsProxy($this->_conf, $url);
|
||||||
$this->assertTrue($yourls->isError());
|
$this->assertTrue($yourls->isError());
|
||||||
$this->assertEquals($yourls->getError(), 'Invalid URL given.');
|
$this->assertEquals($yourls->getError(), 'Invalid URL given.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerInvalidUrl() {
|
public function providerInvalidUrl(): array {
|
||||||
return [
|
return [
|
||||||
[''],
|
[''],
|
||||||
[' '],
|
[' '],
|
||||||
|
@ -75,7 +75,7 @@ class YourlsProxyTest extends TestCase
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testForeignUrlUsingUsernameTrick()
|
public function testForeignUrlUsingUsernameTrick(): void
|
||||||
{
|
{
|
||||||
$yourls = new YourlsProxy($this->_conf, 'https://example.com/@foreign.malicious.example?foo#bar');
|
$yourls = new YourlsProxy($this->_conf, 'https://example.com/@foreign.malicious.example?foo#bar');
|
||||||
$this->assertTrue($yourls->isError());
|
$this->assertTrue($yourls->isError());
|
||||||
|
@ -85,14 +85,14 @@ class YourlsProxyTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerForeignUrl
|
* @dataProvider providerForeignUrl
|
||||||
*/
|
*/
|
||||||
public function testForeignUrl($url)
|
public function testForeignUrl($url): void
|
||||||
{
|
{
|
||||||
$yourls = new YourlsProxy($this->_conf, $url);
|
$yourls = new YourlsProxy($this->_conf, $url);
|
||||||
$this->assertTrue($yourls->isError());
|
$this->assertTrue($yourls->isError());
|
||||||
$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() {
|
public function providerForeignUrl(): array {
|
||||||
return [
|
return [
|
||||||
['ftp://example.com/?n=np'], // wrong protocol
|
['ftp://example.com/?n=np'], // wrong protocol
|
||||||
['https://other.example.com/?foo#bar'], // wrong domain
|
['https://other.example.com/?foo#bar'], // wrong domain
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue