1
1
Fork 0

Remove Phpunit/Dbunit

- Introduce own Yaml-to-SQL class
- Introduce new way of MySQL-DB-tests (per rollback)
- Remove dependency phpunit/dbunit
- Introduce new dev-dependency for YAML-ready (Symfony YAML reader)
This commit is contained in:
Philipp Holzer 2019-07-28 17:40:42 +02:00
commit b08ac3c0a7
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
9 changed files with 771 additions and 429 deletions

View file

@ -114,12 +114,12 @@
] ]
}, },
"require-dev": { "require-dev": {
"phpunit/dbunit": "^2.0",
"phpdocumentor/reflection-docblock": "^3.0.2", "phpdocumentor/reflection-docblock": "^3.0.2",
"phpunit/php-token-stream": "^1.4.2", "phpunit/php-token-stream": "^1.4.2",
"mikey179/vfsstream": "^1.6", "mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2", "mockery/mockery": "^1.2",
"johnkary/phpunit-speedtrap": "1.1" "johnkary/phpunit-speedtrap": "1.1",
"symfony/yaml": "^3.0"
}, },
"scripts": { "scripts": {
"test": "phpunit" "test": "phpunit"

12
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b9ea7162aa7ede630a2090c883e1174b", "content-hash": "ab69901def2561415a0de62fb86df9bf",
"packages": [ "packages": [
{ {
"name": "asika/simple-console", "name": "asika/simple-console",
@ -4267,16 +4267,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.4.16", "version": "v3.4.30",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "61973ecda60e9f3561e929e19c07d4878b960fc1" "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/61973ecda60e9f3561e929e19c07d4878b960fc1", "url": "https://api.github.com/repos/symfony/yaml/zipball/051d045c684148060ebfc9affb7e3f5e0899d40b",
"reference": "61973ecda60e9f3561e929e19c07d4878b960fc1", "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4322,7 +4322,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2018-09-24T08:15:45+00:00" "time": "2019-07-24T13:01:31+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",

View file

@ -6,41 +6,28 @@
namespace Friendica\Test; namespace Friendica\Test;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
/** /**
* Abstract class used by tests that need a database. * Abstract class used by tests that need a database.
*/ */
abstract class DatabaseTest extends MockedTest abstract class DatabaseTest extends MockedTest
{ {
use TestCaseTrait; protected function setUp()
/**
* Get database connection.
*
* This function is executed before each test in order to get a database connection that can be used by tests.
* If no prior connection is available, it tries to create one using the USER, PASS and DB environment variables.
*
* If it could not connect to the database, the test is skipped.
*
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @see https://phpunit.de/manual/5.7/en/database.html
*/
protected function getConnection()
{ {
return $this->createDefaultDBConnection(StaticDatabase::getGlobConnection(), getenv('MYSQL_DATABASE')); parent::setUp();
StaticDatabase::statConnect($_SERVER);
// Rollbacks every DB usage (in case the test couldn't call tearDown)
StaticDatabase::statRollback();
// Start the first, outer transaction
StaticDatabase::getGlobConnection()->beginTransaction();
} }
/** protected function tearDown()
* Get dataset to populate the database with.
*
* @return YamlDataSet
* @see https://phtablepunit.de/manual/5.7/en/database.html
*/
protected function getDataSet()
{ {
return new YamlDataSet(__DIR__ . '/datasets/api.yml'); // Rollbacks every DB usage so we don't commit anything into the DB
StaticDatabase::statRollback();
parent::tearDown();
} }
} }

View file

@ -9,6 +9,8 @@ use PDOException;
/** /**
* Overrides the Friendica database class for re-using the connection * Overrides the Friendica database class for re-using the connection
* for different tests * for different tests
*
* Overrides functionality to enforce one transaction per call (for nested transactions)
*/ */
class StaticDatabase extends Database class StaticDatabase extends Database
{ {
@ -29,41 +31,7 @@ class StaticDatabase extends Database
} }
if (!isset(self::$staticConnection)) { if (!isset(self::$staticConnection)) {
self::statConnect($_SERVER);
$port = 0;
$serveraddr = trim($this->configCache->get('database', 'hostname'));
$serverdata = explode(':', $serveraddr);
$server = $serverdata[0];
if (count($serverdata) > 1) {
$port = trim($serverdata[1]);
}
$server = trim($server);
$user = trim($this->configCache->get('database', 'username'));
$pass = trim($this->configCache->get('database', 'password'));
$db = trim($this->configCache->get('database', 'database'));
$charset = trim($this->configCache->get('database', 'charset'));
if (!(strlen($server) && strlen($user))) {
return false;
}
$connect = "mysql:host=" . $server . ";dbname=" . $db;
if ($port > 0) {
$connect .= ";port=" . $port;
}
if ($charset) {
$connect .= ";charset=" . $charset;
}
try {
self::$staticConnection = @new ExtendedPDO($connect, $user, $pass);
self::$staticConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
} catch (PDOException $e) {
/// @TODO At least log exception, don't ignore it!
}
} }
$this->driver = 'pdo'; $this->driver = 'pdo';
@ -80,7 +48,7 @@ class StaticDatabase extends Database
*/ */
public function transaction() public function transaction()
{ {
if (!$this->connection->inTransaction() && !$this->connection->beginTransaction()) { if (!$this->in_transaction && !$this->connection->beginTransaction()) {
return false; return false;
} }
@ -102,6 +70,64 @@ class StaticDatabase extends Database
return true; return true;
} }
/**
* Setup of the global, static connection
* Either through explicit calling or through implicit using the Database
*
* @param array $server $_SERVER variables
*/
public static function statConnect(array $server)
{
// Use environment variables for mysql if they are set beforehand
if (!empty($server['MYSQL_HOST'])
&& !empty($server['MYSQL_USERNAME'] || !empty($server['MYSQL_USER']))
&& $server['MYSQL_PASSWORD'] !== false
&& !empty($server['MYSQL_DATABASE']))
{
$db_host = $server['MYSQL_HOST'];
if (!empty($server['MYSQL_PORT'])) {
$db_host .= ':' . $server['MYSQL_PORT'];
}
if (!empty($server['MYSQL_USERNAME'])) {
$db_user = $server['MYSQL_USERNAME'];
} else {
$db_user = $server['MYSQL_USER'];
}
$db_pw = (string) $server['MYSQL_PASSWORD'];
$db_data = $server['MYSQL_DATABASE'];
}
$port = 0;
$serveraddr = trim($db_host);
$serverdata = explode(':', $serveraddr);
$server = $serverdata[0];
if (count($serverdata) > 1) {
$port = trim($serverdata[1]);
}
$server = trim($server);
$user = trim($db_user);
$pass = trim($db_pw);
$db = trim($db_data);
if (!(strlen($server) && strlen($user))) {
return;
}
$connect = "mysql:host=" . $server . ";dbname=" . $db;
if ($port > 0) {
$connect .= ";port=" . $port;
}
try {
self::$staticConnection = @new ExtendedPDO($connect, $user, $pass);
self::$staticConnection->setAttribute(PDO::ATTR_AUTOCOMMIT,0);
} catch (PDOException $e) {
/// @TODO At least log exception, don't ignore it!
}
}
/** /**
* @return ExtendedPDO The global, static connection * @return ExtendedPDO The global, static connection
*/ */

View file

@ -0,0 +1,50 @@
<?php
namespace Friendica\Test\Util\Database;
use Friendica\Database\Database;
use Symfony\Component\Yaml\Yaml;
/**
* Util class to load YAML files into the database
*/
class YamlDataSet
{
/**
* @var array
*/
private $tables = [];
public function __construct(string $yamlFile)
{
$this->addYamlFile($yamlFile);
}
public function addYamlFile(string $yamlFile)
{
$data = Yaml::parse(file_get_contents($yamlFile));
foreach ($data as $tableName => $rows) {
if (!isset($rows)) {
$rows = [];
}
if (!is_array($rows)) {
continue;
}
foreach ($rows as $key => $value) {
$this->tables[$tableName][$key] = $value;
}
}
}
public function load(Database $database)
{
foreach ($this->tables as $tableName => $rows) {
foreach ($rows as $row) {
$database->insert($tableName, $row);
}
}
}
}

View file

@ -80,7 +80,7 @@ item:
visible: 1 visible: 1
contact-id: 42 contact-id: 42
author-id: 42 author-id: 42
owner-id: 45 owner-id: 42
uid: 42 uid: 42
verb: http://activitystrea.ms/schema/1.0/post verb: http://activitystrea.ms/schema/1.0/post
unseen: 1 unseen: 1
@ -99,7 +99,7 @@ item:
visible: 1 visible: 1
contact-id: 42 contact-id: 42
author-id: 42 author-id: 42
owner-id: 45 owner-id: 42
uid: 42 uid: 42
verb: http://activitystrea.ms/schema/1.0/post verb: http://activitystrea.ms/schema/1.0/post
unseen: 0 unseen: 0

View file

@ -15,6 +15,7 @@ use Friendica\Core\System;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\Database\YamlDataSet;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
require_once __DIR__ . '/../../include/api.php'; require_once __DIR__ . '/../../include/api.php';
@ -47,17 +48,23 @@ class ApiTest extends DatabaseTest
/** /**
* Create variables used by tests. * Create variables used by tests.
*/ */
public function setUp() protected function setUp()
{ {
StaticDatabase::statRollback(); parent::setUp();
$dice = new Dice(); $dice = new Dice();
$dice = $dice->addRules(include __DIR__ . '/../../static/dependencies.config.php'); $dice = $dice->addRules(include __DIR__ . '/../../static/dependencies.config.php');
$dice = $dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]); $dice = $dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
BaseObject::setDependencyInjection($dice); BaseObject::setDependencyInjection($dice);
$this->app = BaseObject::getApp();
parent::setUp(); /** @var Database $dba */
$dba = $dice->create(Database::class);
// Load the API dataset for the whole API
$ymlTester = new YamlDataSet(__DIR__ . '/../datasets/api.yml');
$ymlTester->load($dba);
$this->app = BaseObject::getApp();
$this->app->argc = 1; $this->app->argc = 1;
$this->app->argv = ['home']; $this->app->argv = ['home'];
@ -92,6 +99,10 @@ class ApiTest extends DatabaseTest
'uid' => $this->selfUser['id'] 'uid' => $this->selfUser['id']
]; ];
$_POST = [];
$_GET = [];
$_SERVER = [];
Config::set('system', 'url', 'http://localhost'); Config::set('system', 'url', 'http://localhost');
Config::set('system', 'hostname', 'localhost'); Config::set('system', 'hostname', 'localhost');
Config::set('system', 'worker_dont_fork', true); Config::set('system', 'worker_dont_fork', true);
@ -104,14 +115,11 @@ class ApiTest extends DatabaseTest
Config::set('system', 'theme', 'system_theme'); Config::set('system', 'theme', 'system_theme');
} }
protected function tearDown()
{
StaticDatabase::statRollback();
}
/** /**
* Assert that an user array contains expected keys. * Assert that an user array contains expected keys.
*
* @param array $user User array * @param array $user User array
*
* @return void * @return void
*/ */
private function assertSelfUser(array $user) private function assertSelfUser(array $user)
@ -128,7 +136,9 @@ class ApiTest extends DatabaseTest
/** /**
* Assert that an user array contains expected keys. * Assert that an user array contains expected keys.
*
* @param array $user User array * @param array $user User array
*
* @return void * @return void
*/ */
private function assertOtherUser(array $user) private function assertOtherUser(array $user)
@ -143,7 +153,9 @@ class ApiTest extends DatabaseTest
/** /**
* Assert that a status array contains expected keys. * Assert that a status array contains expected keys.
*
* @param array $status Status array * @param array $status Status array
*
* @return void * @return void
*/ */
private function assertStatus(array $status) private function assertStatus(array $status)
@ -155,7 +167,9 @@ class ApiTest extends DatabaseTest
/** /**
* Assert that a list array contains expected keys. * Assert that a list array contains expected keys.
*
* @param array $list List array * @param array $list List array
*
* @return void * @return void
*/ */
private function assertList(array $list) private function assertList(array $list)
@ -169,8 +183,10 @@ class ApiTest extends DatabaseTest
/** /**
* Assert that the string is XML and contain the root element. * Assert that the string is XML and contain the root element.
*
* @param string $result XML string * @param string $result XML string
* @param string $root_element Root element name * @param string $root_element Root element name
*
* @return void * @return void
*/ */
private function assertXml($result, $root_element) private function assertXml($result, $root_element)
@ -182,6 +198,7 @@ class ApiTest extends DatabaseTest
/** /**
* Get the path to a temporary empty PNG image. * Get the path to a temporary empty PNG image.
*
* @return string Path * @return string Path
*/ */
private function getTempImage() private function getTempImage()
@ -200,6 +217,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_user() function. * Test the api_user() function.
*
* @return void * @return void
*/ */
public function testApiUser() public function testApiUser()
@ -209,6 +227,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_user() function with an unallowed user. * Test the api_user() function with an unallowed user.
*
* @return void * @return void
*/ */
public function testApiUserWithUnallowedUser() public function testApiUserWithUnallowedUser()
@ -219,6 +238,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_source() function. * Test the api_source() function.
*
* @return void * @return void
*/ */
public function testApiSource() public function testApiSource()
@ -228,6 +248,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_source() function with a Twidere user agent. * Test the api_source() function with a Twidere user agent.
*
* @return void * @return void
*/ */
public function testApiSourceWithTwidere() public function testApiSourceWithTwidere()
@ -238,6 +259,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_source() function with a GET parameter. * Test the api_source() function with a GET parameter.
*
* @return void * @return void
*/ */
public function testApiSourceWithGet() public function testApiSourceWithGet()
@ -248,6 +270,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_date() function. * Test the api_date() function.
*
* @return void * @return void
*/ */
public function testApiDate() public function testApiDate()
@ -257,6 +280,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_register_func() function. * Test the api_register_func() function.
*
* @return void * @return void
*/ */
public function testApiRegisterFunc() public function testApiRegisterFunc()
@ -278,6 +302,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function without any login. * Test the api_login() function without any login.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
* @expectedException Friendica\Network\HTTPException\UnauthorizedException * @expectedException Friendica\Network\HTTPException\UnauthorizedException
@ -289,6 +314,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function with a bad login. * Test the api_login() function with a bad login.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
* @expectedException Friendica\Network\HTTPException\UnauthorizedException * @expectedException Friendica\Network\HTTPException\UnauthorizedException
@ -301,6 +327,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function with oAuth. * Test the api_login() function with oAuth.
*
* @return void * @return void
*/ */
public function testApiLoginWithOauth() public function testApiLoginWithOauth()
@ -310,6 +337,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function with authentication provided by an addon. * Test the api_login() function with authentication provided by an addon.
*
* @return void * @return void
*/ */
public function testApiLoginWithAddonAuth() public function testApiLoginWithAddonAuth()
@ -319,6 +347,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function with a correct login. * Test the api_login() function with a correct login.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -331,6 +360,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_login() function with a remote user. * Test the api_login() function with a remote user.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
* @expectedException Friendica\Network\HTTPException\UnauthorizedException * @expectedException Friendica\Network\HTTPException\UnauthorizedException
@ -343,6 +373,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_check_method() function. * Test the api_check_method() function.
*
* @return void * @return void
*/ */
public function testApiCheckMethod() public function testApiCheckMethod()
@ -352,6 +383,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_check_method() function with a correct method. * Test the api_check_method() function with a correct method.
*
* @return void * @return void
*/ */
public function testApiCheckMethodWithCorrectMethod() public function testApiCheckMethodWithCorrectMethod()
@ -362,6 +394,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_check_method() function with a wildcard. * Test the api_check_method() function with a wildcard.
*
* @return void * @return void
*/ */
public function testApiCheckMethodWithWildcard() public function testApiCheckMethodWithWildcard()
@ -371,6 +404,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function. * Test the api_call() function.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -395,6 +429,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with the profiled enabled. * Test the api_call() function with the profiled enabled.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -427,6 +462,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function without any result. * Test the api_call() function without any result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -450,6 +486,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an unimplemented API. * Test the api_call() function with an unimplemented API.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -463,6 +500,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with a JSON result. * Test the api_call() function with a JSON result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -486,6 +524,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an XML result. * Test the api_call() function with an XML result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -509,6 +548,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an RSS result. * Test the api_call() function with an RSS result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -533,6 +573,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an Atom result. * Test the api_call() function with an Atom result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -557,6 +598,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an unallowed method. * Test the api_call() function with an unallowed method.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -574,6 +616,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_call() function with an unauthorized user. * Test the api_call() function with an unauthorized user.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -596,6 +639,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_error() function with a JSON result. * Test the api_error() function with a JSON result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -609,6 +653,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_error() function with an XML result. * Test the api_error() function with an XML result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -629,6 +674,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_error() function with an RSS result. * Test the api_error() function with an RSS result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -649,6 +695,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_error() function with an Atom result. * Test the api_error() function with an Atom result.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -669,6 +716,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_rss_extra() function. * Test the api_rss_extra() function.
*
* @return void * @return void
*/ */
public function testApiRssExtra() public function testApiRssExtra()
@ -687,8 +735,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_rss_extra() function without any user info. * Test the api_rss_extra() function without any user info.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiRssExtraWithoutUserInfo() public function testApiRssExtraWithoutUserInfo()
{ {
@ -705,6 +753,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_unique_id_to_nurl() function. * Test the api_unique_id_to_nurl() function.
*
* @return void * @return void
*/ */
public function testApiUniqueIdToNurl() public function testApiUniqueIdToNurl()
@ -714,6 +763,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_unique_id_to_nurl() function with a correct ID. * Test the api_unique_id_to_nurl() function with a correct ID.
*
* @return void * @return void
*/ */
public function testApiUniqueIdToNurlWithCorrectId() public function testApiUniqueIdToNurlWithCorrectId()
@ -723,8 +773,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function. * Test the api_get_user() function.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUser() public function testApiGetUser()
{ {
@ -737,8 +787,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a Frio schema. * Test the api_get_user() function with a Frio schema.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithFrioSchema() public function testApiGetUserWithFrioSchema()
{ {
@ -752,8 +802,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a custom Frio schema. * Test the api_get_user() function with a custom Frio schema.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithCustomFrioSchema() public function testApiGetUserWithCustomFrioSchema()
{ {
@ -770,8 +820,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with an empty Frio schema. * Test the api_get_user() function with an empty Frio schema.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithEmptyFrioSchema() public function testApiGetUserWithEmptyFrioSchema()
{ {
@ -785,6 +835,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with an user that is not allowed to use the API. * Test the api_get_user() function with an user that is not allowed to use the API.
*
* @return void * @return void
* @runInSeparateProcess * @runInSeparateProcess
*/ */
@ -798,8 +849,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with an user ID in a GET parameter. * Test the api_get_user() function with an user ID in a GET parameter.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithGetId() public function testApiGetUserWithGetId()
{ {
@ -809,8 +860,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a wrong user ID in a GET parameter. * Test the api_get_user() function with a wrong user ID in a GET parameter.
*
* @return void * @return void
* @runInSeparateProcess
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
public function testApiGetUserWithWrongGetId() public function testApiGetUserWithWrongGetId()
@ -821,8 +872,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with an user name in a GET parameter. * Test the api_get_user() function with an user name in a GET parameter.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithGetName() public function testApiGetUserWithGetName()
{ {
@ -832,8 +883,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a profile URL in a GET parameter. * Test the api_get_user() function with a profile URL in a GET parameter.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithGetUrl() public function testApiGetUserWithGetUrl()
{ {
@ -843,8 +894,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with an user ID in the API path. * Test the api_get_user() function with an user ID in the API path.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithNumericCalledApi() public function testApiGetUserWithNumericCalledApi()
{ {
@ -856,8 +907,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with the $called_api global variable. * Test the api_get_user() function with the $called_api global variable.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithCalledApi() public function testApiGetUserWithCalledApi()
{ {
@ -868,8 +919,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a valid user. * Test the api_get_user() function with a valid user.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithCorrectUser() public function testApiGetUserWithCorrectUser()
{ {
@ -878,8 +929,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a wrong user ID. * Test the api_get_user() function with a wrong user ID.
*
* @return void * @return void
* @runInSeparateProcess
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
public function testApiGetUserWithWrongUser() public function testApiGetUserWithWrongUser()
@ -889,8 +940,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_user() function with a 0 user ID. * Test the api_get_user() function with a 0 user ID.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiGetUserWithZeroUser() public function testApiGetUserWithZeroUser()
{ {
@ -899,8 +950,8 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_item_get_user() function. * Test the api_item_get_user() function.
*
* @return void * @return void
* @runInSeparateProcess
*/ */
public function testApiItemGetUser() public function testApiItemGetUser()
{ {
@ -910,6 +961,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_item_get_user() function with a different item parent. * Test the api_item_get_user() function with a different item parent.
*
* @return void * @return void
*/ */
public function testApiItemGetUserWithDifferentParent() public function testApiItemGetUserWithDifferentParent()
@ -921,6 +973,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_walk_recursive() function. * Test the api_walk_recursive() function.
*
* @return void * @return void
*/ */
public function testApiWalkRecursive() public function testApiWalkRecursive()
@ -940,6 +993,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_walk_recursive() function with an array. * Test the api_walk_recursive() function with an array.
*
* @return void * @return void
*/ */
public function testApiWalkRecursiveWithArray() public function testApiWalkRecursiveWithArray()
@ -959,6 +1013,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_reformat_xml() function. * Test the api_reformat_xml() function.
*
* @return void * @return void
*/ */
public function testApiReformatXml() public function testApiReformatXml()
@ -971,6 +1026,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_reformat_xml() function with a statusnet_api key. * Test the api_reformat_xml() function with a statusnet_api key.
*
* @return void * @return void
*/ */
public function testApiReformatXmlWithStatusnetKey() public function testApiReformatXmlWithStatusnetKey()
@ -983,6 +1039,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_reformat_xml() function with a friendica_api key. * Test the api_reformat_xml() function with a friendica_api key.
*
* @return void * @return void
*/ */
public function testApiReformatXmlWithFriendicaKey() public function testApiReformatXmlWithFriendicaKey()
@ -995,6 +1052,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_create_xml() function. * Test the api_create_xml() function.
*
* @return void * @return void
*/ */
public function testApiCreateXml() public function testApiCreateXml()
@ -1012,6 +1070,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_create_xml() function without any XML namespace. * Test the api_create_xml() function without any XML namespace.
*
* @return void * @return void
*/ */
public function testApiCreateXmlWithoutNamespaces() public function testApiCreateXmlWithoutNamespaces()
@ -1027,6 +1086,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_data() function. * Test the api_format_data() function.
*
* @return void * @return void
*/ */
public function testApiFormatData() public function testApiFormatData()
@ -1037,6 +1097,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_data() function with an XML result. * Test the api_format_data() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiFormatDataWithXml() public function testApiFormatDataWithXml()
@ -1054,6 +1115,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_verify_credentials() function. * Test the api_account_verify_credentials() function.
*
* @return void * @return void
*/ */
public function testApiAccountVerifyCredentials() public function testApiAccountVerifyCredentials()
@ -1063,6 +1125,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_verify_credentials() function without an authenticated user. * Test the api_account_verify_credentials() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1074,6 +1137,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the requestdata() function. * Test the requestdata() function.
*
* @return void * @return void
*/ */
public function testRequestdata() public function testRequestdata()
@ -1083,6 +1147,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the requestdata() function with a POST parameter. * Test the requestdata() function with a POST parameter.
*
* @return void * @return void
*/ */
public function testRequestdataWithPost() public function testRequestdataWithPost()
@ -1093,6 +1158,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the requestdata() function with a GET parameter. * Test the requestdata() function with a GET parameter.
*
* @return void * @return void
*/ */
public function testRequestdataWithGet() public function testRequestdataWithGet()
@ -1103,6 +1169,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mediap() function. * Test the api_statuses_mediap() function.
*
* @return void * @return void
*/ */
public function testApiStatusesMediap() public function testApiStatusesMediap()
@ -1128,6 +1195,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mediap() function without an authenticated user. * Test the api_statuses_mediap() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1139,6 +1207,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function. * Test the api_statuses_update() function.
*
* @return void * @return void
*/ */
public function testApiStatusesUpdate() public function testApiStatusesUpdate()
@ -1165,6 +1234,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function with an HTML status. * Test the api_statuses_update() function with an HTML status.
*
* @return void * @return void
*/ */
public function testApiStatusesUpdateWithHtml() public function testApiStatusesUpdateWithHtml()
@ -1177,6 +1247,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function without an authenticated user. * Test the api_statuses_update() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1188,6 +1259,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function with a parent status. * Test the api_statuses_update() function with a parent status.
*
* @return void * @return void
*/ */
public function testApiStatusesUpdateWithParent() public function testApiStatusesUpdateWithParent()
@ -1197,6 +1269,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function with a media_ids parameter. * Test the api_statuses_update() function with a media_ids parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesUpdateWithMediaIds() public function testApiStatusesUpdateWithMediaIds()
@ -1206,6 +1279,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_update() function with the throttle limit reached. * Test the api_statuses_update() function with the throttle limit reached.
*
* @return void * @return void
*/ */
public function testApiStatusesUpdateWithDayThrottleReached() public function testApiStatusesUpdateWithDayThrottleReached()
@ -1215,6 +1289,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_media_upload() function. * Test the api_media_upload() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1225,6 +1300,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_media_upload() function without an authenticated user. * Test the api_media_upload() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1236,6 +1312,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_media_upload() function with an invalid uploaded media. * Test the api_media_upload() function with an invalid uploaded media.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\InternalServerErrorException * @expectedException Friendica\Network\HTTPException\InternalServerErrorException
*/ */
@ -1252,6 +1329,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_media_upload() function with an valid uploaded media. * Test the api_media_upload() function with an valid uploaded media.
*
* @return void * @return void
*/ */
public function testApiMediaUploadWithValidMedia() public function testApiMediaUploadWithValidMedia()
@ -1307,6 +1385,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_show() function. * Test the api_users_show() function.
*
* @return void * @return void
*/ */
public function testApiUsersShow() public function testApiUsersShow()
@ -1323,6 +1402,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_show() function with an XML result. * Test the api_users_show() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiUsersShowWithXml() public function testApiUsersShowWithXml()
@ -1333,6 +1413,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_search() function. * Test the api_users_search() function.
*
* @return void * @return void
*/ */
public function testApiUsersSearch() public function testApiUsersSearch()
@ -1344,6 +1425,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_search() function with an XML result. * Test the api_users_search() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiUsersSearchWithXml() public function testApiUsersSearchWithXml()
@ -1355,6 +1437,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_search() function without a GET q parameter. * Test the api_users_search() function without a GET q parameter.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1365,6 +1448,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_lookup() function. * Test the api_users_lookup() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\NotFoundException * @expectedException Friendica\Network\HTTPException\NotFoundException
*/ */
@ -1375,6 +1459,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_users_lookup() function with an user ID. * Test the api_users_lookup() function with an user ID.
*
* @return void * @return void
*/ */
public function testApiUsersLookupWithUserId() public function testApiUsersLookupWithUserId()
@ -1386,6 +1471,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function. * Test the api_search() function.
*
* @return void * @return void
*/ */
public function testApiSearch() public function testApiSearch()
@ -1401,6 +1487,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function a count parameter. * Test the api_search() function a count parameter.
*
* @return void * @return void
*/ */
public function testApiSearchWithCount() public function testApiSearchWithCount()
@ -1416,6 +1503,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function with an rpp parameter. * Test the api_search() function with an rpp parameter.
*
* @return void * @return void
*/ */
public function testApiSearchWithRpp() public function testApiSearchWithRpp()
@ -1431,6 +1519,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function with an q parameter contains hashtag. * Test the api_search() function with an q parameter contains hashtag.
*
* @return void * @return void
*/ */
public function testApiSearchWithHashtag() public function testApiSearchWithHashtag()
@ -1445,6 +1534,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function with an exclude_replies parameter. * Test the api_search() function with an exclude_replies parameter.
*
* @return void * @return void
*/ */
public function testApiSearchWithExcludeReplies() public function testApiSearchWithExcludeReplies()
@ -1460,6 +1550,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function without an authenticated user. * Test the api_search() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1472,6 +1563,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_search() function without any GET query parameter. * Test the api_search() function without any GET query parameter.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1482,6 +1574,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_home_timeline() function. * Test the api_statuses_home_timeline() function.
*
* @return void * @return void
*/ */
public function testApiStatusesHomeTimeline() public function testApiStatusesHomeTimeline()
@ -1498,6 +1591,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_home_timeline() function with a negative page parameter. * Test the api_statuses_home_timeline() function with a negative page parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesHomeTimelineWithNegativePage() public function testApiStatusesHomeTimelineWithNegativePage()
@ -1512,6 +1606,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_home_timeline() with an unallowed user. * Test the api_statuses_home_timeline() with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1524,6 +1619,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_home_timeline() function with an RSS result. * Test the api_statuses_home_timeline() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiStatusesHomeTimelineWithRss() public function testApiStatusesHomeTimelineWithRss()
@ -1534,6 +1630,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_public_timeline() function. * Test the api_statuses_public_timeline() function.
*
* @return void * @return void
*/ */
public function testApiStatusesPublicTimeline() public function testApiStatusesPublicTimeline()
@ -1549,6 +1646,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_public_timeline() function with the exclude_replies parameter. * Test the api_statuses_public_timeline() function with the exclude_replies parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesPublicTimelineWithExcludeReplies() public function testApiStatusesPublicTimelineWithExcludeReplies()
@ -1564,6 +1662,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_public_timeline() function with a negative page parameter. * Test the api_statuses_public_timeline() function with a negative page parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesPublicTimelineWithNegativePage() public function testApiStatusesPublicTimelineWithNegativePage()
@ -1578,6 +1677,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_public_timeline() function with an unallowed user. * Test the api_statuses_public_timeline() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1590,6 +1690,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_public_timeline() function with an RSS result. * Test the api_statuses_public_timeline() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiStatusesPublicTimelineWithRss() public function testApiStatusesPublicTimelineWithRss()
@ -1600,6 +1701,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_networkpublic_timeline() function. * Test the api_statuses_networkpublic_timeline() function.
*
* @return void * @return void
*/ */
public function testApiStatusesNetworkpublicTimeline() public function testApiStatusesNetworkpublicTimeline()
@ -1614,6 +1716,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_networkpublic_timeline() function with a negative page parameter. * Test the api_statuses_networkpublic_timeline() function with a negative page parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesNetworkpublicTimelineWithNegativePage() public function testApiStatusesNetworkpublicTimelineWithNegativePage()
@ -1628,6 +1731,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_networkpublic_timeline() function with an unallowed user. * Test the api_statuses_networkpublic_timeline() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1640,6 +1744,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_networkpublic_timeline() function with an RSS result. * Test the api_statuses_networkpublic_timeline() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiStatusesNetworkpublicTimelineWithRss() public function testApiStatusesNetworkpublicTimelineWithRss()
@ -1650,6 +1755,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_show() function. * Test the api_statuses_show() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1660,6 +1766,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_show() function with an ID. * Test the api_statuses_show() function with an ID.
*
* @return void * @return void
*/ */
public function testApiStatusesShowWithId() public function testApiStatusesShowWithId()
@ -1671,6 +1778,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_show() function with the conversation parameter. * Test the api_statuses_show() function with the conversation parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesShowWithConversation() public function testApiStatusesShowWithConversation()
@ -1686,6 +1794,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_show() function with an unallowed user. * Test the api_statuses_show() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1698,6 +1807,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_conversation_show() function. * Test the api_conversation_show() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1708,6 +1818,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_conversation_show() function with an ID. * Test the api_conversation_show() function with an ID.
*
* @return void * @return void
*/ */
public function testApiConversationShowWithId() public function testApiConversationShowWithId()
@ -1724,6 +1835,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_conversation_show() function with an unallowed user. * Test the api_conversation_show() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1736,6 +1848,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_repeat() function. * Test the api_statuses_repeat() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1746,6 +1859,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_repeat() function without an authenticated user. * Test the api_statuses_repeat() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1757,6 +1871,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_repeat() function with an ID. * Test the api_statuses_repeat() function with an ID.
*
* @return void * @return void
*/ */
public function testApiStatusesRepeatWithId() public function testApiStatusesRepeatWithId()
@ -1773,6 +1888,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_destroy() function. * Test the api_statuses_destroy() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1783,6 +1899,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_destroy() function without an authenticated user. * Test the api_statuses_destroy() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1794,6 +1911,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_destroy() function with an ID. * Test the api_statuses_destroy() function with an ID.
*
* @return void * @return void
*/ */
public function testApiStatusesDestroyWithId() public function testApiStatusesDestroyWithId()
@ -1805,6 +1923,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mentions() function. * Test the api_statuses_mentions() function.
*
* @return void * @return void
*/ */
public function testApiStatusesMentions() public function testApiStatusesMentions()
@ -1818,6 +1937,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mentions() function with a negative page parameter. * Test the api_statuses_mentions() function with a negative page parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesMentionsWithNegativePage() public function testApiStatusesMentionsWithNegativePage()
@ -1829,6 +1949,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mentions() function with an unallowed user. * Test the api_statuses_mentions() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1841,6 +1962,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_mentions() function with an RSS result. * Test the api_statuses_mentions() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiStatusesMentionsWithRss() public function testApiStatusesMentionsWithRss()
@ -1851,6 +1973,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_user_timeline() function. * Test the api_statuses_user_timeline() function.
*
* @return void * @return void
*/ */
public function testApiStatusesUserTimeline() public function testApiStatusesUserTimeline()
@ -1867,6 +1990,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_user_timeline() function with a negative page parameter. * Test the api_statuses_user_timeline() function with a negative page parameter.
*
* @return void * @return void
*/ */
public function testApiStatusesUserTimelineWithNegativePage() public function testApiStatusesUserTimelineWithNegativePage()
@ -1881,6 +2005,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_user_timeline() function with an RSS result. * Test the api_statuses_user_timeline() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiStatusesUserTimelineWithRss() public function testApiStatusesUserTimelineWithRss()
@ -1891,6 +2016,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_user_timeline() function with an unallowed user. * Test the api_statuses_user_timeline() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1903,6 +2029,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function. * Test the api_favorites_create_destroy() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1915,6 +2042,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function with an invalid ID. * Test the api_favorites_create_destroy() function with an invalid ID.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1927,6 +2055,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function with an invalid action. * Test the api_favorites_create_destroy() function with an invalid action.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -1940,6 +2069,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function with the create action. * Test the api_favorites_create_destroy() function with the create action.
*
* @return void * @return void
*/ */
public function testApiFavoritesCreateDestroyWithCreateAction() public function testApiFavoritesCreateDestroyWithCreateAction()
@ -1953,6 +2083,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function with the create action and an RSS result. * Test the api_favorites_create_destroy() function with the create action and an RSS result.
*
* @return void * @return void
*/ */
public function testApiFavoritesCreateDestroyWithCreateActionAndRss() public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
@ -1966,6 +2097,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function with the destroy action. * Test the api_favorites_create_destroy() function with the destroy action.
*
* @return void * @return void
*/ */
public function testApiFavoritesCreateDestroyWithDestroyAction() public function testApiFavoritesCreateDestroyWithDestroyAction()
@ -1979,6 +2111,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites_create_destroy() function without an authenticated user. * Test the api_favorites_create_destroy() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -1992,6 +2125,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites() function. * Test the api_favorites() function.
*
* @return void * @return void
*/ */
public function testApiFavorites() public function testApiFavorites()
@ -2006,6 +2140,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites() function with an RSS result. * Test the api_favorites() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiFavoritesWithRss() public function testApiFavoritesWithRss()
@ -2016,6 +2151,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_favorites() function with an unallowed user. * Test the api_favorites() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2028,6 +2164,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_messages() function. * Test the api_format_messages() function.
*
* @return void * @return void
*/ */
public function testApiFormatMessages() public function testApiFormatMessages()
@ -2047,6 +2184,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_messages() function with HTML. * Test the api_format_messages() function with HTML.
*
* @return void * @return void
*/ */
public function testApiFormatMessagesWithHtmlText() public function testApiFormatMessagesWithHtmlText()
@ -2063,6 +2201,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_messages() function with plain text. * Test the api_format_messages() function with plain text.
*
* @return void * @return void
*/ */
public function testApiFormatMessagesWithPlainText() public function testApiFormatMessagesWithPlainText()
@ -2079,6 +2218,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_messages() function with the getUserObjects GET parameter set to false. * Test the api_format_messages() function with the getUserObjects GET parameter set to false.
*
* @return void * @return void
*/ */
public function testApiFormatMessagesWithoutUserObjects() public function testApiFormatMessagesWithoutUserObjects()
@ -2095,6 +2235,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_convert_item() function. * Test the api_convert_item() function.
*
* @return void * @return void
*/ */
public function testApiConvertItem() public function testApiConvertItem()
@ -2136,6 +2277,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_convert_item() function with an empty item body. * Test the api_convert_item() function with an empty item body.
*
* @return void * @return void
*/ */
public function testApiConvertItemWithoutBody() public function testApiConvertItemWithoutBody()
@ -2154,6 +2296,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_convert_item() function with the title in the body. * Test the api_convert_item() function with the title in the body.
*
* @return void * @return void
*/ */
public function testApiConvertItemWithTitleInBody() public function testApiConvertItemWithTitleInBody()
@ -2170,6 +2313,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_attachments() function. * Test the api_get_attachments() function.
*
* @return void * @return void
*/ */
public function testApiGetAttachments() public function testApiGetAttachments()
@ -2180,6 +2324,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_attachments() function with an img tag. * Test the api_get_attachments() function with an img tag.
*
* @return void * @return void
*/ */
public function testApiGetAttachmentsWithImage() public function testApiGetAttachmentsWithImage()
@ -2190,6 +2335,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_attachments() function with an img tag and an AndStatus user agent. * Test the api_get_attachments() function with an img tag and an AndStatus user agent.
*
* @return void * @return void
*/ */
public function testApiGetAttachmentsWithImageAndAndStatus() public function testApiGetAttachmentsWithImageAndAndStatus()
@ -2201,6 +2347,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_entitities() function. * Test the api_get_entitities() function.
*
* @return void * @return void
*/ */
public function testApiGetEntitities() public function testApiGetEntitities()
@ -2211,6 +2358,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_entitities() function with the include_entities parameter. * Test the api_get_entitities() function with the include_entities parameter.
*
* @return void * @return void
*/ */
public function testApiGetEntititiesWithIncludeEntities() public function testApiGetEntititiesWithIncludeEntities()
@ -2226,6 +2374,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items_embeded_images() function. * Test the api_format_items_embeded_images() function.
*
* @return void * @return void
*/ */
public function testApiFormatItemsEmbededImages() public function testApiFormatItemsEmbededImages()
@ -2238,6 +2387,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_contactlink_to_array() function. * Test the api_contactlink_to_array() function.
*
* @return void * @return void
*/ */
public function testApiContactlinkToArray() public function testApiContactlinkToArray()
@ -2253,6 +2403,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_contactlink_to_array() function with an URL. * Test the api_contactlink_to_array() function with an URL.
*
* @return void * @return void
*/ */
public function testApiContactlinkToArrayWithUrl() public function testApiContactlinkToArrayWithUrl()
@ -2268,6 +2419,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items_activities() function. * Test the api_format_items_activities() function.
*
* @return void * @return void
*/ */
public function testApiFormatItemsActivities() public function testApiFormatItemsActivities()
@ -2283,6 +2435,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items_activities() function with an XML result. * Test the api_format_items_activities() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiFormatItemsActivitiesWithXml() public function testApiFormatItemsActivitiesWithXml()
@ -2298,6 +2451,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items_profiles() function. * Test the api_format_items_profiles() function.
*
* @return void * @return void
*/ */
public function testApiFormatItemsProfiles() public function testApiFormatItemsProfiles()
@ -2393,6 +2547,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items() function. * Test the api_format_items() function.
*
* @return void * @return void
*/ */
public function testApiFormatItems() public function testApiFormatItems()
@ -2418,6 +2573,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items() function with an XML result. * Test the api_format_items() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiFormatItemsWithXml() public function testApiFormatItemsWithXml()
@ -2441,6 +2597,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items() function. * Test the api_format_items() function.
*
* @return void * @return void
*/ */
public function testApiAccountRateLimitStatus() public function testApiAccountRateLimitStatus()
@ -2453,6 +2610,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_format_items() function with an XML result. * Test the api_format_items() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiAccountRateLimitStatusWithXml() public function testApiAccountRateLimitStatusWithXml()
@ -2463,6 +2621,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_help_test() function. * Test the api_help_test() function.
*
* @return void * @return void
*/ */
public function testApiHelpTest() public function testApiHelpTest()
@ -2473,6 +2632,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_help_test() function with an XML result. * Test the api_help_test() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiHelpTestWithXml() public function testApiHelpTestWithXml()
@ -2483,6 +2643,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_list() function. * Test the api_lists_list() function.
*
* @return void * @return void
*/ */
public function testApiListsList() public function testApiListsList()
@ -2493,6 +2654,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_ownerships() function. * Test the api_lists_ownerships() function.
*
* @return void * @return void
*/ */
public function testApiListsOwnerships() public function testApiListsOwnerships()
@ -2505,6 +2667,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_ownerships() function without an authenticated user. * Test the api_lists_ownerships() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2516,6 +2679,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_statuses() function. * Test the api_lists_statuses() function.
*
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
* @return void * @return void
*/ */
@ -2526,6 +2690,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_statuses() function with a list ID. * Test the api_lists_statuses() function with a list ID.
*
* @return void * @return void
*/ */
public function testApiListsStatusesWithListId() public function testApiListsStatusesWithListId()
@ -2541,6 +2706,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_statuses() function with a list ID and a RSS result. * Test the api_lists_statuses() function with a list ID and a RSS result.
*
* @return void * @return void
*/ */
public function testApiListsStatusesWithListIdAndRss() public function testApiListsStatusesWithListIdAndRss()
@ -2552,6 +2718,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_statuses() function with an unallowed user. * Test the api_lists_statuses() function with an unallowed user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2564,6 +2731,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_f() function. * Test the api_statuses_f() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFWithFriends() public function testApiStatusesFWithFriends()
@ -2575,6 +2743,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_f() function. * Test the api_statuses_f() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFWithFollowers() public function testApiStatusesFWithFollowers()
@ -2585,6 +2754,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_f() function. * Test the api_statuses_f() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFWithBlocks() public function testApiStatusesFWithBlocks()
@ -2595,6 +2765,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_f() function. * Test the api_statuses_f() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFWithIncoming() public function testApiStatusesFWithIncoming()
@ -2605,6 +2776,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_f() function an undefined cursor GET variable. * Test the api_statuses_f() function an undefined cursor GET variable.
*
* @return void * @return void
*/ */
public function testApiStatusesFWithUndefinedCursor() public function testApiStatusesFWithUndefinedCursor()
@ -2615,6 +2787,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_friends() function. * Test the api_statuses_friends() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFriends() public function testApiStatusesFriends()
@ -2625,6 +2798,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_friends() function an undefined cursor GET variable. * Test the api_statuses_friends() function an undefined cursor GET variable.
*
* @return void * @return void
*/ */
public function testApiStatusesFriendsWithUndefinedCursor() public function testApiStatusesFriendsWithUndefinedCursor()
@ -2635,6 +2809,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_followers() function. * Test the api_statuses_followers() function.
*
* @return void * @return void
*/ */
public function testApiStatusesFollowers() public function testApiStatusesFollowers()
@ -2645,6 +2820,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statuses_followers() function an undefined cursor GET variable. * Test the api_statuses_followers() function an undefined cursor GET variable.
*
* @return void * @return void
*/ */
public function testApiStatusesFollowersWithUndefinedCursor() public function testApiStatusesFollowersWithUndefinedCursor()
@ -2655,6 +2831,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_blocks_list() function. * Test the api_blocks_list() function.
*
* @return void * @return void
*/ */
public function testApiBlocksList() public function testApiBlocksList()
@ -2665,6 +2842,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_blocks_list() function an undefined cursor GET variable. * Test the api_blocks_list() function an undefined cursor GET variable.
*
* @return void * @return void
*/ */
public function testApiBlocksListWithUndefinedCursor() public function testApiBlocksListWithUndefinedCursor()
@ -2675,6 +2853,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendships_incoming() function. * Test the api_friendships_incoming() function.
*
* @return void * @return void
*/ */
public function testApiFriendshipsIncoming() public function testApiFriendshipsIncoming()
@ -2685,6 +2864,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendships_incoming() function an undefined cursor GET variable. * Test the api_friendships_incoming() function an undefined cursor GET variable.
*
* @return void * @return void
*/ */
public function testApiFriendshipsIncomingWithUndefinedCursor() public function testApiFriendshipsIncomingWithUndefinedCursor()
@ -2695,6 +2875,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statusnet_config() function. * Test the api_statusnet_config() function.
*
* @return void * @return void
*/ */
public function testApiStatusnetConfig() public function testApiStatusnetConfig()
@ -2714,6 +2895,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_statusnet_version() function. * Test the api_statusnet_version() function.
*
* @return void * @return void
*/ */
public function testApiStatusnetVersion() public function testApiStatusnetVersion()
@ -2724,6 +2906,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_ff_ids() function. * Test the api_ff_ids() function.
*
* @return void * @return void
*/ */
public function testApiFfIds() public function testApiFfIds()
@ -2734,6 +2917,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_ff_ids() function with a result. * Test the api_ff_ids() function with a result.
*
* @return void * @return void
*/ */
public function testApiFfIdsWithResult() public function testApiFfIdsWithResult()
@ -2743,6 +2927,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_ff_ids() function without an authenticated user. * Test the api_ff_ids() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2754,6 +2939,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friends_ids() function. * Test the api_friends_ids() function.
*
* @return void * @return void
*/ */
public function testApiFriendsIds() public function testApiFriendsIds()
@ -2764,6 +2950,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_followers_ids() function. * Test the api_followers_ids() function.
*
* @return void * @return void
*/ */
public function testApiFollowersIds() public function testApiFollowersIds()
@ -2774,6 +2961,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function. * Test the api_direct_messages_new() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesNew() public function testApiDirectMessagesNew()
@ -2784,6 +2972,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function without an authenticated user. * Test the api_direct_messages_new() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2795,6 +2984,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function with an user ID. * Test the api_direct_messages_new() function with an user ID.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesNewWithUserId() public function testApiDirectMessagesNewWithUserId()
@ -2807,6 +2997,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function with a screen name. * Test the api_direct_messages_new() function with a screen name.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesNewWithScreenName() public function testApiDirectMessagesNewWithScreenName()
@ -2814,7 +3005,6 @@ class ApiTest extends DatabaseTest
$_POST['text'] = 'message_text'; $_POST['text'] = 'message_text';
$_POST['screen_name'] = $this->friendUser['nick']; $_POST['screen_name'] = $this->friendUser['nick'];
$result = api_direct_messages_new('json'); $result = api_direct_messages_new('json');
$this->assertEquals(1, $result['direct_message']['id']);
$this->assertContains('message_text', $result['direct_message']['text']); $this->assertContains('message_text', $result['direct_message']['text']);
$this->assertEquals('selfcontact', $result['direct_message']['sender_screen_name']); $this->assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
$this->assertEquals(1, $result['direct_message']['friendica_seen']); $this->assertEquals(1, $result['direct_message']['friendica_seen']);
@ -2822,6 +3012,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function with a title. * Test the api_direct_messages_new() function with a title.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesNewWithTitle() public function testApiDirectMessagesNewWithTitle()
@ -2830,7 +3021,6 @@ class ApiTest extends DatabaseTest
$_POST['screen_name'] = $this->friendUser['nick']; $_POST['screen_name'] = $this->friendUser['nick'];
$_REQUEST['title'] = 'message_title'; $_REQUEST['title'] = 'message_title';
$result = api_direct_messages_new('json'); $result = api_direct_messages_new('json');
$this->assertEquals(1, $result['direct_message']['id']);
$this->assertContains('message_text', $result['direct_message']['text']); $this->assertContains('message_text', $result['direct_message']['text']);
$this->assertContains('message_title', $result['direct_message']['text']); $this->assertContains('message_title', $result['direct_message']['text']);
$this->assertEquals('selfcontact', $result['direct_message']['sender_screen_name']); $this->assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
@ -2839,6 +3029,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_new() function with an RSS result. * Test the api_direct_messages_new() function with an RSS result.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesNewWithRss() public function testApiDirectMessagesNewWithRss()
@ -2851,6 +3042,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() function. * Test the api_direct_messages_destroy() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -2861,6 +3053,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() function with the friendica_verbose GET param. * Test the api_direct_messages_destroy() function with the friendica_verbose GET param.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesDestroyWithVerbose() public function testApiDirectMessagesDestroyWithVerbose()
@ -2880,6 +3073,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() function without an authenticated user. * Test the api_direct_messages_destroy() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -2891,6 +3085,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() function with a non-zero ID. * Test the api_direct_messages_destroy() function with a non-zero ID.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -2902,6 +3097,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() with a non-zero ID and the friendica_verbose GET param. * Test the api_direct_messages_destroy() with a non-zero ID and the friendica_verbose GET param.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesDestroyWithIdAndVerbose() public function testApiDirectMessagesDestroyWithIdAndVerbose()
@ -2923,6 +3119,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_destroy() function with a non-zero ID. * Test the api_direct_messages_destroy() function with a non-zero ID.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesDestroyWithCorrectId() public function testApiDirectMessagesDestroyWithCorrectId()
@ -2932,6 +3129,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithSentbox() public function testApiDirectMessagesBoxWithSentbox()
@ -2944,6 +3142,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithConversation() public function testApiDirectMessagesBoxWithConversation()
@ -2954,6 +3153,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithAll() public function testApiDirectMessagesBoxWithAll()
@ -2964,6 +3164,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithInbox() public function testApiDirectMessagesBoxWithInbox()
@ -2974,6 +3175,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithVerbose() public function testApiDirectMessagesBoxWithVerbose()
@ -2992,6 +3194,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function with a RSS result. * Test the api_direct_messages_box() function with a RSS result.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesBoxWithRss() public function testApiDirectMessagesBoxWithRss()
@ -3002,6 +3205,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_box() function without an authenticated user. * Test the api_direct_messages_box() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3014,6 +3218,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_sentbox() function. * Test the api_direct_messages_sentbox() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesSentbox() public function testApiDirectMessagesSentbox()
@ -3024,6 +3229,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_inbox() function. * Test the api_direct_messages_inbox() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesInbox() public function testApiDirectMessagesInbox()
@ -3034,6 +3240,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_all() function. * Test the api_direct_messages_all() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesAll() public function testApiDirectMessagesAll()
@ -3044,6 +3251,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_direct_messages_conversation() function. * Test the api_direct_messages_conversation() function.
*
* @return void * @return void
*/ */
public function testApiDirectMessagesConversation() public function testApiDirectMessagesConversation()
@ -3054,6 +3262,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_oauth_request_token() function. * Test the api_oauth_request_token() function.
*
* @return void * @return void
*/ */
public function testApiOauthRequestToken() public function testApiOauthRequestToken()
@ -3063,6 +3272,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_oauth_access_token() function. * Test the api_oauth_access_token() function.
*
* @return void * @return void
*/ */
public function testApiOauthAccessToken() public function testApiOauthAccessToken()
@ -3072,6 +3282,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function. * Test the api_fr_photoalbum_delete() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3082,6 +3293,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function with an album name. * Test the api_fr_photoalbum_delete() function with an album name.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3093,6 +3305,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function with an album name. * Test the api_fr_photoalbum_delete() function with an album name.
*
* @return void * @return void
*/ */
public function testApiFrPhotoalbumDeleteWithValidAlbum() public function testApiFrPhotoalbumDeleteWithValidAlbum()
@ -3102,6 +3315,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function. * Test the api_fr_photoalbum_delete() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3112,6 +3326,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function with an album name. * Test the api_fr_photoalbum_delete() function with an album name.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3123,6 +3338,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function with an album name. * Test the api_fr_photoalbum_delete() function with an album name.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3135,6 +3351,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_update() function without an authenticated user. * Test the api_fr_photoalbum_update() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3146,6 +3363,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photoalbum_delete() function with an album name. * Test the api_fr_photoalbum_delete() function with an album name.
*
* @return void * @return void
*/ */
public function testApiFrPhotoalbumUpdateWithValidAlbum() public function testApiFrPhotoalbumUpdateWithValidAlbum()
@ -3155,6 +3373,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photos_list() function. * Test the api_fr_photos_list() function.
*
* @return void * @return void
*/ */
public function testApiFrPhotosList() public function testApiFrPhotosList()
@ -3165,6 +3384,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photos_list() function without an authenticated user. * Test the api_fr_photos_list() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3176,6 +3396,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_create_update() function. * Test the api_fr_photo_create_update() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3186,6 +3407,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_create_update() function without an authenticated user. * Test the api_fr_photo_create_update() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3197,6 +3419,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_create_update() function with an album name. * Test the api_fr_photo_create_update() function with an album name.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3208,6 +3431,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_create_update() function with the update mode. * Test the api_fr_photo_create_update() function with the update mode.
*
* @return void * @return void
*/ */
public function testApiFrPhotoCreateUpdateWithUpdate() public function testApiFrPhotoCreateUpdateWithUpdate()
@ -3217,6 +3441,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_create_update() function with an uploaded file. * Test the api_fr_photo_create_update() function with an uploaded file.
*
* @return void * @return void
*/ */
public function testApiFrPhotoCreateUpdateWithFile() public function testApiFrPhotoCreateUpdateWithFile()
@ -3226,6 +3451,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_delete() function. * Test the api_fr_photo_delete() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3236,6 +3462,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_delete() function without an authenticated user. * Test the api_fr_photo_delete() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3247,6 +3474,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_delete() function with a photo ID. * Test the api_fr_photo_delete() function with a photo ID.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3258,6 +3486,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_delete() function with a correct photo ID. * Test the api_fr_photo_delete() function with a correct photo ID.
*
* @return void * @return void
*/ */
public function testApiFrPhotoDeleteWithCorrectPhotoId() public function testApiFrPhotoDeleteWithCorrectPhotoId()
@ -3267,6 +3496,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_detail() function. * Test the api_fr_photo_detail() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3277,6 +3507,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_detail() function without an authenticated user. * Test the api_fr_photo_detail() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3288,6 +3519,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_detail() function with a photo ID. * Test the api_fr_photo_detail() function with a photo ID.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\NotFoundException * @expectedException Friendica\Network\HTTPException\NotFoundException
*/ */
@ -3299,6 +3531,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_fr_photo_detail() function with a correct photo ID. * Test the api_fr_photo_detail() function with a correct photo ID.
*
* @return void * @return void
*/ */
public function testApiFrPhotoDetailCorrectPhotoId() public function testApiFrPhotoDetailCorrectPhotoId()
@ -3308,6 +3541,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_update_profile_image() function. * Test the api_account_update_profile_image() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3318,6 +3552,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_update_profile_image() function without an authenticated user. * Test the api_account_update_profile_image() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3329,6 +3564,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_update_profile_image() function with an uploaded file. * Test the api_account_update_profile_image() function with an uploaded file.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3340,6 +3576,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_account_update_profile() function. * Test the api_account_update_profile() function.
*
* @return void * @return void
*/ */
public function testApiAccountUpdateProfile() public function testApiAccountUpdateProfile()
@ -3358,6 +3595,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the check_acl_input() function. * Test the check_acl_input() function.
*
* @return void * @return void
*/ */
public function testCheckAclInput() public function testCheckAclInput()
@ -3369,6 +3607,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the check_acl_input() function with an empty ACL string. * Test the check_acl_input() function with an empty ACL string.
*
* @return void * @return void
*/ */
public function testCheckAclInputWithEmptyAclString() public function testCheckAclInputWithEmptyAclString()
@ -3379,6 +3618,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the save_media_to_database() function. * Test the save_media_to_database() function.
*
* @return void * @return void
*/ */
public function testSaveMediaToDatabase() public function testSaveMediaToDatabase()
@ -3388,6 +3628,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the post_photo_item() function. * Test the post_photo_item() function.
*
* @return void * @return void
*/ */
public function testPostPhotoItem() public function testPostPhotoItem()
@ -3397,6 +3638,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the prepare_photo_data() function. * Test the prepare_photo_data() function.
*
* @return void * @return void
*/ */
public function testPreparePhotoData() public function testPreparePhotoData()
@ -3406,6 +3648,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_remoteauth() function. * Test the api_friendica_remoteauth() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3416,6 +3659,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_remoteauth() function with an URL. * Test the api_friendica_remoteauth() function with an URL.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3428,6 +3672,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_remoteauth() function with a correct URL. * Test the api_friendica_remoteauth() function with a correct URL.
*
* @return void * @return void
*/ */
public function testApiFriendicaRemoteauthWithCorrectUrl() public function testApiFriendicaRemoteauthWithCorrectUrl()
@ -3440,6 +3685,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_share_as_retweet() function. * Test the api_share_as_retweet() function.
*
* @return void * @return void
*/ */
public function testApiShareAsRetweet() public function testApiShareAsRetweet()
@ -3451,6 +3697,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_share_as_retweet() function with a valid item. * Test the api_share_as_retweet() function with a valid item.
*
* @return void * @return void
*/ */
public function testApiShareAsRetweetWithValidItem() public function testApiShareAsRetweetWithValidItem()
@ -3460,6 +3707,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_nick() function. * Test the api_get_nick() function.
*
* @return void * @return void
*/ */
public function testApiGetNick() public function testApiGetNick()
@ -3470,6 +3718,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_get_nick() function with a wrong URL. * Test the api_get_nick() function with a wrong URL.
*
* @return void * @return void
*/ */
public function testApiGetNickWithWrongUrl() public function testApiGetNickWithWrongUrl()
@ -3480,6 +3729,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_in_reply_to() function. * Test the api_in_reply_to() function.
*
* @return void * @return void
*/ */
public function testApiInReplyTo() public function testApiInReplyTo()
@ -3494,6 +3744,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_in_reply_to() function with a valid item. * Test the api_in_reply_to() function with a valid item.
*
* @return void * @return void
*/ */
public function testApiInReplyToWithValidItem() public function testApiInReplyToWithValidItem()
@ -3503,6 +3754,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_clean_plain_items() function. * Test the api_clean_plain_items() function.
*
* @return void * @return void
*/ */
public function testApiCleanPlainItems() public function testApiCleanPlainItems()
@ -3514,6 +3766,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_clean_attachments() function. * Test the api_clean_attachments() function.
*
* @return void * @return void
*/ */
public function testApiCleanAttachments() public function testApiCleanAttachments()
@ -3523,6 +3776,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_best_nickname() function. * Test the api_best_nickname() function.
*
* @return void * @return void
*/ */
public function testApiBestNickname() public function testApiBestNickname()
@ -3534,6 +3788,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_best_nickname() function with contacts. * Test the api_best_nickname() function with contacts.
*
* @return void * @return void
*/ */
public function testApiBestNicknameWithContacts() public function testApiBestNicknameWithContacts()
@ -3543,6 +3798,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_group_show() function. * Test the api_friendica_group_show() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaGroupShow() public function testApiFriendicaGroupShow()
@ -3552,6 +3808,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_group_delete() function. * Test the api_friendica_group_delete() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaGroupDelete() public function testApiFriendicaGroupDelete()
@ -3561,6 +3818,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_destroy() function. * Test the api_lists_destroy() function.
*
* @return void * @return void
*/ */
public function testApiListsDestroy() public function testApiListsDestroy()
@ -3570,6 +3828,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the group_create() function. * Test the group_create() function.
*
* @return void * @return void
*/ */
public function testGroupCreate() public function testGroupCreate()
@ -3579,6 +3838,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_group_create() function. * Test the api_friendica_group_create() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaGroupCreate() public function testApiFriendicaGroupCreate()
@ -3588,6 +3848,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_create() function. * Test the api_lists_create() function.
*
* @return void * @return void
*/ */
public function testApiListsCreate() public function testApiListsCreate()
@ -3597,6 +3858,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_group_update() function. * Test the api_friendica_group_update() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaGroupUpdate() public function testApiFriendicaGroupUpdate()
@ -3606,6 +3868,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_lists_update() function. * Test the api_lists_update() function.
*
* @return void * @return void
*/ */
public function testApiListsUpdate() public function testApiListsUpdate()
@ -3615,6 +3878,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_activity() function. * Test the api_friendica_activity() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaActivity() public function testApiFriendicaActivity()
@ -3624,6 +3888,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_notification() function. * Test the api_friendica_notification() function.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3634,6 +3899,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_notification() function without an authenticated user. * Test the api_friendica_notification() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3645,6 +3911,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_notification() function with an argument count. * Test the api_friendica_notification() function with an argument count.
*
* @return void * @return void
*/ */
public function testApiFriendicaNotificationWithArgumentCount() public function testApiFriendicaNotificationWithArgumentCount()
@ -3657,6 +3924,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_notification() function with an XML result. * Test the api_friendica_notification() function with an XML result.
*
* @return void * @return void
*/ */
public function testApiFriendicaNotificationWithXmlResult() public function testApiFriendicaNotificationWithXmlResult()
@ -3669,6 +3937,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_notification_seen() function. * Test the api_friendica_notification_seen() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaNotificationSeen() public function testApiFriendicaNotificationSeen()
@ -3678,6 +3947,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_direct_messages_setseen() function. * Test the api_friendica_direct_messages_setseen() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaDirectMessagesSetseen() public function testApiFriendicaDirectMessagesSetseen()
@ -3687,6 +3957,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_direct_messages_search() function. * Test the api_friendica_direct_messages_search() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaDirectMessagesSearch() public function testApiFriendicaDirectMessagesSearch()
@ -3696,6 +3967,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_profile_show() function. * Test the api_friendica_profile_show() function.
*
* @return void * @return void
*/ */
public function testApiFriendicaProfileShow() public function testApiFriendicaProfileShow()
@ -3713,6 +3985,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_profile_show() function with a profile ID. * Test the api_friendica_profile_show() function with a profile ID.
*
* @return void * @return void
*/ */
public function testApiFriendicaProfileShowWithProfileId() public function testApiFriendicaProfileShowWithProfileId()
@ -3722,6 +3995,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_profile_show() function with a wrong profile ID. * Test the api_friendica_profile_show() function with a wrong profile ID.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\BadRequestException * @expectedException Friendica\Network\HTTPException\BadRequestException
*/ */
@ -3733,6 +4007,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_friendica_profile_show() function without an authenticated user. * Test the api_friendica_profile_show() function without an authenticated user.
*
* @return void * @return void
* @expectedException Friendica\Network\HTTPException\ForbiddenException * @expectedException Friendica\Network\HTTPException\ForbiddenException
*/ */
@ -3744,6 +4019,7 @@ class ApiTest extends DatabaseTest
/** /**
* Test the api_saved_searches_list() function. * Test the api_saved_searches_list() function.
*
* @return void * @return void
*/ */
public function testApiSavedSearchesList() public function testApiSavedSearchesList()

View file

@ -4,8 +4,10 @@ namespace Friendica\Test\src\Database;
use Dice\Dice; use Dice\Dice;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTest;
use Friendica\Test\Util\Database\StaticDatabase;
class DBATest extends DatabaseTest class DBATest extends DatabaseTest
{ {
@ -15,6 +17,7 @@ class DBATest extends DatabaseTest
$dice = new Dice(); $dice = new Dice();
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php'); $dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
$dice = $dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
BaseObject::setDependencyInjection($dice); BaseObject::setDependencyInjection($dice);
// Default config // Default config

View file

@ -4,20 +4,20 @@ namespace Friendica\Test\src\Database;
use Dice\Dice; use Dice\Dice;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Database\Database;
use Friendica\Database\DBStructure; use Friendica\Database\DBStructure;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTest;
use Friendica\Test\Util\Database\StaticDatabase;
class DBStructureTest extends DatabaseTest class DBStructureTest extends DatabaseTest
{ {
/** protected function setUp()
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function setUp()
{ {
parent::setUp(); parent::setUp();
$dice = new Dice(); $dice = new Dice();
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php'); $dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
$dice = $dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
BaseObject::setDependencyInjection($dice); BaseObject::setDependencyInjection($dice);
} }