2015-10-12 00:50:48 +08:00
|
|
|
<?php
|
2016-07-21 23:09:48 +08:00
|
|
|
|
2020-10-10 18:08:58 +08:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-07-29 22:15:52 +08:00
|
|
|
use PrivateBin\Controller;
|
2016-08-09 17:54:42 +08:00
|
|
|
use PrivateBin\Data\Filesystem;
|
2016-10-29 16:24:08 +08:00
|
|
|
use PrivateBin\Persistence\ServerSalt;
|
2016-08-09 17:54:42 +08:00
|
|
|
use PrivateBin\Request;
|
2016-07-21 23:09:48 +08:00
|
|
|
|
2020-10-10 18:08:58 +08:00
|
|
|
class JsonApiTest extends TestCase
|
2015-10-12 00:50:48 +08:00
|
|
|
{
|
|
|
|
protected $_model;
|
|
|
|
|
2016-08-09 17:54:42 +08:00
|
|
|
protected $_path;
|
|
|
|
|
2020-10-10 18:22:20 +08:00
|
|
|
public function setUp(): void
|
2015-10-12 00:50:48 +08:00
|
|
|
{
|
|
|
|
/* Setup Routine */
|
2016-10-29 16:24:08 +08:00
|
|
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
2022-10-23 19:09:54 +08:00
|
|
|
if (!is_dir($this->_path)) {
|
|
|
|
mkdir($this->_path);
|
|
|
|
}
|
2022-10-28 07:01:02 +08:00
|
|
|
$this->_model = new Filesystem(array('dir' => $this->_path));
|
2021-06-09 04:01:29 +08:00
|
|
|
ServerSalt::setStore($this->_model);
|
2015-10-12 00:50:48 +08:00
|
|
|
|
2016-10-29 16:24:08 +08:00
|
|
|
$_POST = array();
|
|
|
|
$_GET = array();
|
2015-10-12 00:50:48 +08:00
|
|
|
$_SERVER = array();
|
2016-08-09 17:54:42 +08:00
|
|
|
if ($this->_model->exists(Helper::getPasteId())) {
|
|
|
|
$this->_model->delete(Helper::getPasteId());
|
2016-07-26 14:19:35 +08:00
|
|
|
}
|
2017-10-08 17:03:17 +08:00
|
|
|
$options = parse_ini_file(CONF_SAMPLE, true);
|
2016-08-09 17:54:42 +08:00
|
|
|
$options['model_options']['dir'] = $this->_path;
|
|
|
|
Helper::confBackup();
|
|
|
|
Helper::createIniFile(CONF, $options);
|
2015-10-12 00:50:48 +08:00
|
|
|
}
|
|
|
|
|
2020-10-10 18:22:20 +08:00
|
|
|
public function tearDown(): void
|
2017-10-08 17:03:17 +08:00
|
|
|
{
|
|
|
|
/* Tear Down Routine */
|
|
|
|
unlink(CONF);
|
|
|
|
Helper::confRestore();
|
|
|
|
Helper::rmDir($this->_path);
|
|
|
|
}
|
|
|
|
|
2015-10-12 00:50:48 +08:00
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testCreate()
|
|
|
|
{
|
2016-10-29 16:24:08 +08:00
|
|
|
$options = parse_ini_file(CONF, true);
|
2015-10-12 00:50:48 +08:00
|
|
|
$options['traffic']['limit'] = 0;
|
2016-08-09 17:54:42 +08:00
|
|
|
Helper::createIniFile(CONF, $options);
|
2019-05-14 04:31:52 +08:00
|
|
|
$paste = Helper::getPasteJson();
|
|
|
|
$file = tempnam(sys_get_temp_dir(), 'FOO');
|
|
|
|
file_put_contents($file, $paste);
|
|
|
|
Request::setInputStream($file);
|
2015-10-12 00:50:48 +08:00
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['REQUEST_METHOD'] = 'POST';
|
|
|
|
$_SERVER['REMOTE_ADDR'] = '::1';
|
2019-05-12 04:18:35 +08:00
|
|
|
$_SERVER['REQUEST_URI'] = '/';
|
2015-10-12 00:50:48 +08:00
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-12 00:50:48 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-12 00:50:48 +08:00
|
|
|
$response = json_decode($content, true);
|
|
|
|
$this->assertEquals(0, $response['status'], 'outputs status');
|
2016-07-06 17:37:13 +08:00
|
|
|
$this->assertStringEndsWith('?' . $response['id'], $response['url'], 'returned URL points to new paste');
|
|
|
|
$this->assertTrue($this->_model->exists($response['id']), 'paste exists after posting data');
|
|
|
|
$paste = $this->_model->read($response['id']);
|
2015-10-12 00:50:48 +08:00
|
|
|
$this->assertEquals(
|
2019-05-09 04:11:21 +08:00
|
|
|
hash_hmac('sha256', $response['id'], $paste['meta']['salt']),
|
2015-10-12 00:50:48 +08:00
|
|
|
$response['deletetoken'],
|
|
|
|
'outputs valid delete token'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testPut()
|
|
|
|
{
|
2016-10-29 16:24:08 +08:00
|
|
|
$options = parse_ini_file(CONF, true);
|
2015-10-12 00:50:48 +08:00
|
|
|
$options['traffic']['limit'] = 0;
|
2016-08-09 17:54:42 +08:00
|
|
|
Helper::createIniFile(CONF, $options);
|
2019-05-14 04:31:52 +08:00
|
|
|
$paste = Helper::getPasteJson();
|
2019-05-11 03:45:34 +08:00
|
|
|
$file = tempnam(sys_get_temp_dir(), 'FOO');
|
2019-05-14 04:31:52 +08:00
|
|
|
file_put_contents($file, $paste);
|
2016-08-09 17:54:42 +08:00
|
|
|
Request::setInputStream($file);
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['QUERY_STRING'] = Helper::getPasteId();
|
2019-01-22 06:49:33 +08:00
|
|
|
$_GET[Helper::getPasteId()] = '';
|
2015-10-12 00:50:48 +08:00
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
|
|
|
$_SERVER['REMOTE_ADDR'] = '::1';
|
2015-10-12 00:50:48 +08:00
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-12 00:50:48 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2017-03-25 06:42:11 +08:00
|
|
|
unlink($file);
|
2015-10-12 00:50:48 +08:00
|
|
|
$response = json_decode($content, true);
|
|
|
|
$this->assertEquals(0, $response['status'], 'outputs status');
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->assertEquals(Helper::getPasteId(), $response['id'], 'outputted paste ID matches input');
|
2016-07-06 17:37:13 +08:00
|
|
|
$this->assertStringEndsWith('?' . $response['id'], $response['url'], 'returned URL points to new paste');
|
|
|
|
$this->assertTrue($this->_model->exists($response['id']), 'paste exists after posting data');
|
|
|
|
$paste = $this->_model->read($response['id']);
|
2015-10-12 00:50:48 +08:00
|
|
|
$this->assertEquals(
|
2019-05-09 04:11:21 +08:00
|
|
|
hash_hmac('sha256', $response['id'], $paste['meta']['salt']),
|
2015-10-12 00:50:48 +08:00
|
|
|
$response['deletetoken'],
|
|
|
|
'outputs valid delete token'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-12 03:22:00 +08:00
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testDelete()
|
|
|
|
{
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->_model->create(Helper::getPasteId(), Helper::getPaste());
|
|
|
|
$this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
|
|
|
$paste = $this->_model->read(Helper::getPasteId());
|
2016-10-29 16:24:08 +08:00
|
|
|
$file = tempnam(sys_get_temp_dir(), 'FOO');
|
2019-05-14 04:31:52 +08:00
|
|
|
file_put_contents($file, json_encode(array(
|
2019-05-09 04:11:21 +08:00
|
|
|
'deletetoken' => hash_hmac('sha256', Helper::getPasteId(), $paste['meta']['salt']),
|
2015-10-12 03:22:00 +08:00
|
|
|
)));
|
2016-08-09 17:54:42 +08:00
|
|
|
Request::setInputStream($file);
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['QUERY_STRING'] = Helper::getPasteId();
|
2019-01-22 06:49:33 +08:00
|
|
|
$_GET[Helper::getPasteId()] = '';
|
2015-10-12 03:22:00 +08:00
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['REQUEST_METHOD'] = 'DELETE';
|
2015-10-12 03:22:00 +08:00
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-12 03:22:00 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2017-03-25 06:42:11 +08:00
|
|
|
unlink($file);
|
2015-10-12 03:22:00 +08:00
|
|
|
$response = json_decode($content, true);
|
|
|
|
$this->assertEquals(0, $response['status'], 'outputs status');
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste successfully deleted');
|
2015-10-12 03:22:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testDeleteWithPost()
|
|
|
|
{
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->_model->create(Helper::getPasteId(), Helper::getPaste());
|
|
|
|
$this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
|
|
|
$paste = $this->_model->read(Helper::getPasteId());
|
2019-05-14 04:31:52 +08:00
|
|
|
$file = tempnam(sys_get_temp_dir(), 'FOO');
|
|
|
|
file_put_contents($file, json_encode(array(
|
2017-02-23 04:42:14 +08:00
|
|
|
'pasteid' => Helper::getPasteId(),
|
2019-05-09 04:11:21 +08:00
|
|
|
'deletetoken' => hash_hmac('sha256', Helper::getPasteId(), $paste['meta']['salt']),
|
2019-05-14 04:31:52 +08:00
|
|
|
)));
|
|
|
|
Request::setInputStream($file);
|
2015-10-12 03:22:00 +08:00
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['REQUEST_METHOD'] = 'POST';
|
2015-10-12 03:22:00 +08:00
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-12 03:22:00 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-12 03:22:00 +08:00
|
|
|
$response = json_decode($content, true);
|
|
|
|
$this->assertEquals(0, $response['status'], 'outputs status');
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste successfully deleted');
|
2015-10-12 03:22:00 +08:00
|
|
|
}
|
|
|
|
|
2015-10-16 04:04:57 +08:00
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testRead()
|
|
|
|
{
|
2019-05-09 04:11:21 +08:00
|
|
|
$paste = Helper::getPaste();
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->_model->create(Helper::getPasteId(), $paste);
|
2016-10-29 16:24:08 +08:00
|
|
|
$_SERVER['QUERY_STRING'] = Helper::getPasteId();
|
2019-01-22 06:49:33 +08:00
|
|
|
$_GET[Helper::getPasteId()] = '';
|
2015-10-16 04:04:57 +08:00
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-16 04:04:57 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-16 04:04:57 +08:00
|
|
|
$response = json_decode($content, true);
|
|
|
|
$this->assertEquals(0, $response['status'], 'outputs success status');
|
2016-08-09 17:54:42 +08:00
|
|
|
$this->assertEquals(Helper::getPasteId(), $response['id'], 'outputs data correctly');
|
2015-10-18 17:08:28 +08:00
|
|
|
$this->assertStringEndsWith('?' . $response['id'], $response['url'], 'returned URL points to new paste');
|
2019-05-09 04:11:21 +08:00
|
|
|
$this->assertEquals($paste['ct'], $response['ct'], 'outputs data correctly');
|
|
|
|
$this->assertEquals($paste['meta']['created'], $response['meta']['created'], 'outputs postdate correctly');
|
2015-10-18 17:08:28 +08:00
|
|
|
$this->assertEquals(0, $response['comment_count'], 'outputs comment_count correctly');
|
|
|
|
$this->assertEquals(0, $response['comment_offset'], 'outputs comment_offset correctly');
|
2015-10-16 04:04:57 +08:00
|
|
|
}
|
|
|
|
|
2015-10-18 20:37:58 +08:00
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testJsonLdPaste()
|
|
|
|
{
|
|
|
|
$_GET['jsonld'] = 'paste';
|
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-18 20:37:58 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-18 20:46:07 +08:00
|
|
|
$this->assertEquals(str_replace(
|
2023-06-18 18:54:22 +08:00
|
|
|
'?jsonld=',
|
|
|
|
'/?jsonld=',
|
|
|
|
file_get_contents(PUBLIC_PATH . '/js/paste.jsonld')
|
|
|
|
), $content, 'outputs data correctly');
|
2015-10-18 20:46:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testJsonLdComment()
|
|
|
|
{
|
|
|
|
$_GET['jsonld'] = 'comment';
|
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-18 20:46:07 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-18 20:46:07 +08:00
|
|
|
$this->assertEquals(str_replace(
|
2023-06-18 18:54:22 +08:00
|
|
|
'?jsonld=',
|
|
|
|
'/?jsonld=',
|
|
|
|
file_get_contents(PUBLIC_PATH . '/js/comment.jsonld')
|
|
|
|
), $content, 'outputs data correctly');
|
2015-10-18 20:46:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testJsonLdPasteMeta()
|
|
|
|
{
|
|
|
|
$_GET['jsonld'] = 'pastemeta';
|
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-18 20:46:07 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-18 20:46:07 +08:00
|
|
|
$this->assertEquals(str_replace(
|
2023-06-18 18:54:22 +08:00
|
|
|
'?jsonld=',
|
|
|
|
'/?jsonld=',
|
|
|
|
file_get_contents(PUBLIC_PATH . '/js/pastemeta.jsonld')
|
|
|
|
), $content, 'outputs data correctly');
|
2015-10-18 20:46:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testJsonLdCommentMeta()
|
|
|
|
{
|
|
|
|
$_GET['jsonld'] = 'commentmeta';
|
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-18 20:46:07 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-18 20:46:07 +08:00
|
|
|
$this->assertEquals(str_replace(
|
2023-06-18 18:54:22 +08:00
|
|
|
'?jsonld=',
|
|
|
|
'/?jsonld=',
|
|
|
|
file_get_contents(PUBLIC_PATH . '/js/commentmeta.jsonld')
|
|
|
|
), $content, 'outputs data correctly');
|
2015-10-18 20:37:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
2023-01-15 15:04:21 +08:00
|
|
|
*/
|
|
|
|
public function testJsonLdTypes()
|
|
|
|
{
|
|
|
|
$_GET['jsonld'] = 'types';
|
|
|
|
ob_start();
|
|
|
|
new Controller;
|
|
|
|
$content = ob_get_contents();
|
|
|
|
ob_end_clean();
|
|
|
|
$this->assertEquals(str_replace(
|
2023-06-18 18:54:22 +08:00
|
|
|
'?jsonld=',
|
|
|
|
'/?jsonld=',
|
|
|
|
file_get_contents(PUBLIC_PATH . '/js/types.jsonld')
|
|
|
|
), $content, 'outputs data correctly');
|
2023-01-15 15:04:21 +08:00
|
|
|
}
|
2015-10-18 20:37:58 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testJsonLdInvalid()
|
|
|
|
{
|
2017-09-30 00:59:02 +08:00
|
|
|
$_GET['jsonld'] = CONF;
|
2015-10-18 20:37:58 +08:00
|
|
|
ob_start();
|
2018-07-29 21:17:35 +08:00
|
|
|
new Controller;
|
2015-10-18 20:37:58 +08:00
|
|
|
$content = ob_get_contents();
|
2016-08-02 16:29:25 +08:00
|
|
|
ob_end_clean();
|
2015-10-18 20:37:58 +08:00
|
|
|
$this->assertEquals('{}', $content, 'does not output nasty data');
|
|
|
|
}
|
2022-10-23 19:09:54 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
2024-03-16 22:17:58 +08:00
|
|
|
* @dataProvider baseUriProvider
|
2022-10-23 19:09:54 +08:00
|
|
|
*/
|
2024-03-16 22:17:58 +08:00
|
|
|
public function testShortenViaYourls($baseUri)
|
2022-10-23 19:09:54 +08:00
|
|
|
{
|
|
|
|
$mock_yourls_service = $this->_path . DIRECTORY_SEPARATOR . 'yourls.json';
|
|
|
|
$options = parse_ini_file(CONF, true);
|
2022-11-03 14:47:50 +08:00
|
|
|
$options['main']['basepath'] = 'https://example.com/path'; // missing slash gets added by Configuration constructor
|
2024-03-16 22:17:58 +08:00
|
|
|
$options['main']['urlshortener'] = 'https://example.com' . $baseUri . 'link=';
|
2022-10-23 19:09:54 +08:00
|
|
|
$options['yourls']['apiurl'] = $mock_yourls_service;
|
|
|
|
Helper::createIniFile(CONF, $options);
|
|
|
|
|
|
|
|
// the real service answer is more complex, but we only look for the shorturl & statusCode
|
|
|
|
file_put_contents($mock_yourls_service, '{"shorturl":"https:\/\/example.com\/1","statusCode":200}');
|
|
|
|
|
2024-03-16 22:17:58 +08:00
|
|
|
$_SERVER['REQUEST_URI'] = $baseUri . 'link=https%3A%2F%2Fexample.com%2Fpath%2F%3Ffoo%23bar';
|
2022-10-23 19:14:27 +08:00
|
|
|
$_GET['link'] = 'https://example.com/path/?foo#bar';
|
2024-03-16 22:17:58 +08:00
|
|
|
if (strpos($baseUri, '?shortenviayourls') !== false) {
|
|
|
|
$_GET['shortenviayourls'] = null;
|
|
|
|
}
|
2022-10-23 19:09:54 +08:00
|
|
|
ob_start();
|
|
|
|
new Controller;
|
|
|
|
$content = ob_get_contents();
|
|
|
|
ob_end_clean();
|
2024-03-16 22:17:58 +08:00
|
|
|
$this->assertStringContainsString('id="pasteurl" href="https://example.com/1"', $content, "'{$baseUri}' outputs shortened URL correctly");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function baseUriProvider()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
array('/path/shortenviayourls?'),
|
|
|
|
array('/path/index.php/shortenviayourls?'),
|
|
|
|
array('/path?shortenviayourls&'),
|
|
|
|
);
|
2022-10-23 19:09:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @runInSeparateProcess
|
|
|
|
*/
|
|
|
|
public function testShortenViaYourlsFailure()
|
|
|
|
{
|
|
|
|
$_SERVER['REQUEST_URI'] = '/path/shortenviayourls?link=https%3A%2F%2Fexample.com%2Fpath%2F%3Ffoo%23bar';
|
2022-10-23 19:13:12 +08:00
|
|
|
$_GET['link'] = 'https://example.com/path/?foo#bar';
|
2022-10-23 19:09:54 +08:00
|
|
|
ob_start();
|
|
|
|
new Controller;
|
|
|
|
$content = ob_get_contents();
|
|
|
|
ob_end_clean();
|
2022-10-25 12:55:24 +08:00
|
|
|
$this->assertStringContainsString('Error calling YOURLS.', $content, 'outputs error correctly');
|
2022-10-23 19:09:54 +08:00
|
|
|
}
|
2016-07-06 17:37:13 +08:00
|
|
|
}
|