mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-03-05 13:30:32 -05:00
refactor: added AbstractProxy base class for shortener proxies
This commit is contained in:
@@ -336,6 +336,6 @@ class JsonApiTest extends TestCase
|
||||
new Controller;
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$this->assertStringContainsString('Error calling YOURLS.', $content, 'outputs error correctly');
|
||||
$this->assertStringContainsString('Error calling proxy.', $content, 'outputs error correctly');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ class ViewTest extends TestCase
|
||||
$content,
|
||||
$template . ': outputs error correctly'
|
||||
);
|
||||
if ($template === 'yourlsproxy' || $template === 'shlinkproxy') {
|
||||
// yourlsproxy and shlinkproxy templates only display error message
|
||||
if ($template === 'shortenerproxy') {
|
||||
// shortenerproxy template only displays error message
|
||||
continue;
|
||||
}
|
||||
$this->assertMatchesRegularExpression(
|
||||
|
||||
@@ -68,7 +68,7 @@ class YourlsProxyTest extends TestCase
|
||||
|
||||
$yourls = new YourlsProxy($this->_conf, 'https://example.com/?foo#bar');
|
||||
$this->assertTrue($yourls->isError());
|
||||
$this->assertEquals($yourls->getError(), 'Error parsing YOURLS response.');
|
||||
$this->assertEquals($yourls->getError(), 'Error calling proxy. Probably a configuration issue, like wrong or missing config keys.');
|
||||
}
|
||||
|
||||
public function testServerError()
|
||||
@@ -78,6 +78,6 @@ class YourlsProxyTest extends TestCase
|
||||
|
||||
$yourls = new YourlsProxy($this->_conf, 'https://example.com/?foo#bar');
|
||||
$this->assertTrue($yourls->isError());
|
||||
$this->assertEquals($yourls->getError(), 'Error calling YOURLS. Probably a configuration issue, like wrong or missing "apiurl" or "signature".');
|
||||
$this->assertEquals($yourls->getError(), 'Error calling proxy. Probably a configuration issue, like wrong or missing config keys.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user