Merge pull request #14597 from Art4/rearange-testcases

Rearrange testcases
This commit is contained in:
Hypolite Petovan 2024-12-16 09:23:40 -05:00 committed by GitHub
commit 657ccaf226
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
154 changed files with 450 additions and 481 deletions

View file

@ -5,26 +5,23 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Module\Api; namespace Friendica\Test;
use Friendica\App; use Friendica\App;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Special\HTTPException; use Friendica\Module\Special\HTTPException;
use Friendica\Security\Authentication; use Friendica\Security\Authentication;
use Friendica\Security\BasicAuth; use Friendica\Security\BasicAuth;
use Friendica\Test\FixtureTest;
use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AppDouble;
use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthenticationDouble;
use Friendica\Test\Util\AuthTestConfig; use Friendica\Test\Util\AuthTestConfig;
use Mockery\MockInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
abstract class ApiTest extends FixtureTest abstract class ApiTestCase extends FixtureTestCase
{ {
// User data that the test database is populated with // User data that the test database is populated with
const SELF_USER = [ const SELF_USER = [
@ -190,7 +187,7 @@ abstract class ApiTest extends FixtureTest
public function installAuthTest() public function installAuthTest()
{ {
$addon = 'authtest'; $addon = 'authtest';
$addon_file_path = __DIR__ . '/../../../Util/authtest/authtest.php'; $addon_file_path = __DIR__ . '/Util/authtest/authtest.php';
$t = @filemtime($addon_file_path); $t = @filemtime($addon_file_path);
@include_once($addon_file_path); @include_once($addon_file_path);

View file

@ -5,15 +5,13 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test;
use Friendica\Core\Cache\Capability\ICanCache; use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Cache\Capability\ICanCacheInMemory; use Friendica\Test\MockedTestCase;
use Friendica\Core\Cache\Type\AbstractCache;
use Friendica\Test\MockedTest;
use Friendica\Util\PidFile; use Friendica\Util\PidFile;
abstract class CacheTest extends MockedTest abstract class CacheTestCase extends MockedTestCase
{ {
/** /**
* @var int Start time of the mock (used for time operations) * @var int Start time of the mock (used for time operations)

View file

@ -5,13 +5,13 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Console; namespace Friendica\Test;
use Asika\SimpleConsole\Console; use Asika\SimpleConsole\Console;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\Intercept; use Friendica\Test\Util\Intercept;
abstract class ConsoleTest extends MockedTest abstract class ConsoleTestCase extends MockedTestCase
{ {
/** /**
* @var array The default argv for a Console Instance * @var array The default argv for a Console Instance

View file

@ -10,7 +10,7 @@ namespace Friendica\Test;
/** /**
* 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 DatabaseTestCase extends MockedTestCase
{ {
use DatabaseTestTrait; use DatabaseTestTrait;

View file

@ -1,44 +0,0 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test;
use Dice\Dice;
use Friendica\App\Arguments;
use Friendica\App\Router;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\Session\Type\Memory;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\VFSTrait;
/**
* Parent class for test cases requiring fixtures
*/
abstract class FixtureTest extends MockedTest
{
use FixtureTestTrait;
protected function setUp(): void
{
parent::setUp();
$this->setUpFixtures();
}
protected function tearDown(): void
{
$this->tearDownFixtures();
parent::tearDown();
}
}

30
tests/FixtureTestCase.php Normal file
View file

@ -0,0 +1,30 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test;
/**
* Parent class for test cases requiring fixtures
*/
abstract class FixtureTestCase extends MockedTestCase
{
use FixtureTestTrait;
protected function setUp(): void
{
parent::setUp();
$this->setUpFixtures();
}
protected function tearDown(): void
{
$this->tearDownFixtures();
parent::tearDown();
}
}

View file

@ -5,12 +5,12 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Lock; namespace Friendica\Test;
use Friendica\Core\Lock\Capability\ICanLock; use Friendica\Core\Lock\Capability\ICanLock;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
abstract class LockTest extends MockedTest abstract class LockTestCase extends MockedTestCase
{ {
/** /**
* @var int Start time of the mock (used for time operations) * @var int Start time of the mock (used for time operations)

View file

@ -5,7 +5,7 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Logger; namespace Friendica\Test;
trait LoggerDataTrait trait LoggerDataTrait
{ {

View file

@ -5,16 +5,16 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Logger; namespace Friendica\Test;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MockedTest;
use Friendica\Core\Logger\Util\Introspection; use Friendica\Core\Logger\Util\Introspection;
use Friendica\Test\MockedTestCase;
use Mockery\MockInterface; use Mockery\MockInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
abstract class AbstractLoggerTest extends MockedTest abstract class LoggerTestCase extends MockedTestCase
{ {
use LoggerDataTrait; use LoggerDataTrait;

View file

@ -5,12 +5,12 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test;
use Exception; use Exception;
use Friendica\Core\Cache\Capability\ICanCacheInMemory; use Friendica\Core\Cache\Capability\ICanCacheInMemory;
abstract class MemoryCacheTest extends CacheTest abstract class MemoryCacheTestCase extends CacheTestCase
{ {
/** /**
* @var \Friendica\Core\Cache\Capability\ICanCacheInMemory * @var \Friendica\Core\Cache\Capability\ICanCacheInMemory

View file

@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* This class verifies each mock after each call * This class verifies each mock after each call
*/ */
abstract class MockedTest extends TestCase abstract class MockedTestCase extends TestCase
{ {
protected function tearDown() : void protected function tearDown() : void
{ {

View file

@ -5,17 +5,16 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\PConfig; namespace Friendica\Test;
use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
use Friendica\Core\PConfig\Type\AbstractPConfigValues; use Friendica\Core\PConfig\Type\AbstractPConfigValues;
use Friendica\Core\PConfig\Repository\PConfig as PConfigModel; use Friendica\Core\PConfig\Repository\PConfig as PConfigModel;
use Friendica\Core\PConfig\ValueObject\Cache; use Friendica\Core\PConfig\ValueObject\Cache;
use Friendica\Test\MockedTest;
use Mockery; use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
abstract class PConfigTest extends MockedTest abstract class PConfigTestCase extends MockedTestCase
{ {
use ArraySubsetAsserts; use ArraySubsetAsserts;

View file

@ -5,12 +5,12 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Storage; namespace Friendica\Test;
use Friendica\Core\Storage\Capability\ICanConfigureStorage; use Friendica\Core\Storage\Capability\ICanConfigureStorage;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
abstract class StorageConfigTest extends MockedTest abstract class StorageConfigTestCase extends MockedTestCase
{ {
/** @return ICanConfigureStorage */ /** @return ICanConfigureStorage */
abstract protected function getInstance(); abstract protected function getInstance();

View file

@ -5,14 +5,14 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\Storage; namespace Friendica\Test;
use Friendica\Core\Storage\Capability\ICanReadFromStorage; use Friendica\Core\Storage\Capability\ICanReadFromStorage;
use Friendica\Core\Storage\Capability\ICanWriteToStorage; use Friendica\Core\Storage\Capability\ICanWriteToStorage;
use Friendica\Core\Storage\Exception\ReferenceStorageException; use Friendica\Core\Storage\Exception\ReferenceStorageException;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
abstract class StorageTest extends MockedTest abstract class StorageTestCase extends MockedTestCase
{ {
/** @return ICanWriteToStorage */ /** @return ICanWriteToStorage */
abstract protected function getInstance(); abstract protected function getInstance();

View file

@ -14,12 +14,12 @@ use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Lock\Capability\ICanLock; use Friendica\Core\Lock\Capability\ICanLock;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use Friendica\Util\BasePath; use Friendica\Util\BasePath;
use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\Util\ConfigFileManager;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class DependencyCheckTest extends FixtureTest class DependencyCheckTest extends FixtureTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {

View file

@ -9,12 +9,12 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<testsuites> <testsuites>
<testsuite name="friendica"> <testsuite name="friendica">
<directory suffix=".php">functional/</directory> <directory suffix="Test.php">functional/</directory>
<directory suffix=".php">src/</directory> <directory suffix="Test.php">src/</directory>
<directory suffix=".php">Unit/</directory> <directory suffix="Test.php">Unit/</directory>
</testsuite> </testsuite>
<testsuite name="unit"> <testsuite name="unit">
<directory suffix=".php">Unit/</directory> <directory suffix="Test.php">Unit/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<!-- Filters for Code Coverage --> <!-- Filters for Code Coverage -->

View file

@ -11,10 +11,10 @@ use Friendica\App\BaseURL;
use Friendica\Core\Config\Model\ReadOnlyFileConfig; use Friendica\Core\Config\Model\ReadOnlyFileConfig;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class BaseURLTest extends MockedTest class BaseURLTest extends MockedTestCase
{ {
public function dataSystemUrl(): array public function dataSystemUrl(): array
{ {

View file

@ -12,13 +12,13 @@ use Friendica\App\Arguments;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Friendica\Util\BasePath; use Friendica\Util\BasePath;
use Mockery; use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
class ModeTest extends MockedTest class ModeTest extends MockedTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\App;
use Friendica\App\Request; use Friendica\App\Request;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class RequestTest extends MockedTest class RequestTest extends MockedTestCase
{ {
public function dataServerArray(): array public function dataServerArray(): array
{ {

View file

@ -7,11 +7,11 @@
namespace Friendica\Test\src; namespace Friendica\Test\src;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\CollectionDouble; use Friendica\Test\Util\CollectionDouble;
use Friendica\Test\Util\EntityDouble; use Friendica\Test\Util\EntityDouble;
class CollectionTest extends MockedTest class CollectionTest extends MockedTestCase
{ {
/** /**
* Test if the BaseCollection::column() works as expected * Test if the BaseCollection::column() works as expected

View file

@ -16,6 +16,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\ConsoleTestCase;
use Friendica\Test\Util\RendererMockTrait; use Friendica\Test\Util\RendererMockTrait;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Mockery; use Mockery;
@ -24,7 +25,7 @@ use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamFile; use org\bovigo\vfs\vfsStreamFile;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class AutomaticInstallationConsoleTest extends ConsoleTest class AutomaticInstallationConsoleTest extends ConsoleTestCase
{ {
use VFSTrait; use VFSTrait;
use RendererMockTrait; use RendererMockTrait;
@ -273,7 +274,7 @@ Creating config file...
Checking database... Checking database...
[Error] -------- [Error] --------
Could not connect to database.: Could not connect to database.:
FIN; FIN;
@ -633,12 +634,12 @@ Options
-d|--dbdata <database> The name of the mysql/mariadb database (env MYSQL_DATABASE) -d|--dbdata <database> The name of the mysql/mariadb database (env MYSQL_DATABASE)
-U|--dbuser <username> The username of the mysql/mariadb database login (env MYSQL_USER or MYSQL_USERNAME) -U|--dbuser <username> The username of the mysql/mariadb database login (env MYSQL_USER or MYSQL_USERNAME)
-P|--dbpass <password> The password of the mysql/mariadb database login (env MYSQL_PASSWORD) -P|--dbpass <password> The password of the mysql/mariadb database login (env MYSQL_PASSWORD)
-U|--url <url> The full base URL of Friendica - f.e. 'https://friendica.local/sub' (env FRIENDICA_URL) -U|--url <url> The full base URL of Friendica - f.e. 'https://friendica.local/sub' (env FRIENDICA_URL)
-B|--phppath <php_path> The path of the PHP binary (env FRIENDICA_PHP_PATH) -B|--phppath <php_path> The path of the PHP binary (env FRIENDICA_PHP_PATH)
-b|--basepath <base_path> The basepath of Friendica (env FRIENDICA_BASE_PATH) -b|--basepath <base_path> The basepath of Friendica (env FRIENDICA_BASE_PATH)
-t|--tz <timezone> The timezone of Friendica (env FRIENDICA_TZ) -t|--tz <timezone> The timezone of Friendica (env FRIENDICA_TZ)
-L|--lang <language> The language of Friendica (env FRIENDICA_LANG) -L|--lang <language> The language of Friendica (env FRIENDICA_LANG)
Environment variables Environment variables
MYSQL_HOST The host of the mysql/mariadb database (mandatory if mysql and environment is used) MYSQL_HOST The host of the mysql/mariadb database (mandatory if mysql and environment is used)
MYSQL_PORT The port of the mysql/mariadb database MYSQL_PORT The port of the mysql/mariadb database
@ -651,7 +652,7 @@ Environment variables
FRIENDICA_ADMIN_MAIL The admin email address of Friendica (this email will be used for admin access) FRIENDICA_ADMIN_MAIL The admin email address of Friendica (this email will be used for admin access)
FRIENDICA_TZ The timezone of Friendica FRIENDICA_TZ The timezone of Friendica
FRIENDICA_LANG The langauge of Friendica FRIENDICA_LANG The langauge of Friendica
Examples Examples
bin/console autoinstall -f 'input.config.php bin/console autoinstall -f 'input.config.php
Installs Friendica with the prepared 'input.config.php' file Installs Friendica with the prepared 'input.config.php' file

View file

@ -11,11 +11,12 @@ use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Console\Config; use Friendica\Console\Config;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\ConsoleTestCase;
use Mockery; use Mockery;
use Mockery\LegacyMockInterface; use Mockery\LegacyMockInterface;
use Mockery\MockInterface; use Mockery\MockInterface;
class ConfigConsoleTest extends ConsoleTest class ConfigConsoleTest extends ConsoleTestCase
{ {
/** /**
* @var App\Mode|MockInterface $appMode * @var App\Mode|MockInterface $appMode

View file

@ -11,10 +11,11 @@ use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Console\Lock; use Friendica\Console\Lock;
use Friendica\Core\Lock\Capability\ICanLock; use Friendica\Core\Lock\Capability\ICanLock;
use Friendica\Test\ConsoleTestCase;
use Mockery; use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
class LockConsoleTest extends ConsoleTest class LockConsoleTest extends ConsoleTestCase
{ {
/** /**
* @var App\Mode|MockInterface $appMode * @var App\Mode|MockInterface $appMode

View file

@ -9,10 +9,11 @@ namespace Friendica\Test\src\Console;
use Friendica\Console\ServerBlock; use Friendica\Console\ServerBlock;
use Friendica\Moderation\DomainPatternBlocklist; use Friendica\Moderation\DomainPatternBlocklist;
use Friendica\Test\ConsoleTestCase;
use Friendica\Test\FixtureTestTrait; use Friendica\Test\FixtureTestTrait;
use Mockery; use Mockery;
class ServerBlockConsoleTest extends ConsoleTest class ServerBlockConsoleTest extends ConsoleTestCase
{ {
use FixtureTestTrait; use FixtureTestTrait;

View file

@ -9,10 +9,10 @@ namespace Friendica\Test\src\Contact\FriendSuggest\Factory;
use Friendica\Contact\FriendSuggest\Factory\FriendSuggest; use Friendica\Contact\FriendSuggest\Factory\FriendSuggest;
use Friendica\Contact\FriendSuggest\Entity; use Friendica\Contact\FriendSuggest\Entity;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class FriendSuggestTest extends MockedTest class FriendSuggestTest extends MockedTestCase
{ {
public function dataCreate() public function dataCreate()
{ {

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Content; namespace Friendica\Test\src\Content;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class ItemTest extends MockedTest class ItemTest extends MockedTestCase
{ {
/** /**
* @doesNotPerformAssertions * @doesNotPerformAssertions

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Content; namespace Friendica\Test\src\Content;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
class PageInfoTest extends DatabaseTest class PageInfoTest extends DatabaseTestCase
{ {
public function dataGetRelevantUrlFromBody() public function dataGetRelevantUrlFromBody()
{ {

View file

@ -11,9 +11,9 @@ use Friendica\Content\Smilies;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class SmiliesTest extends FixtureTest class SmiliesTest extends FixtureTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -8,9 +8,9 @@
namespace Friendica\Test\src\Content\Text\BBCode; namespace Friendica\Test\src\Content\Text\BBCode;
use Friendica\Content\Text\BBCode\Video; use Friendica\Content\Text\BBCode\Video;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class VideoTest extends MockedTest class VideoTest extends MockedTestCase
{ {
public function dataVideo() public function dataVideo()
{ {

View file

@ -10,10 +10,10 @@ namespace Friendica\Test\src\Content\Text;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use Friendica\Util\Strings; use Friendica\Util\Strings;
class BBCodeTest extends FixtureTest class BBCodeTest extends FixtureTestCase
{ {
/** @var \HTMLPurifier */ /** @var \HTMLPurifier */
public $HTMLPurifier; public $HTMLPurifier;

View file

@ -10,11 +10,11 @@ namespace Friendica\Test\src\Content\Text;
use Exception; use Exception;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use GuzzleHttp\Psr7\Uri; use GuzzleHttp\Psr7\Uri;
use Psr\Http\Message\UriInterface; use Psr\Http\Message\UriInterface;
class HTMLTest extends FixtureTest class HTMLTest extends FixtureTestCase
{ {
public function dataHTML() public function dataHTML()
{ {

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\Content\Text;
use Exception; use Exception;
use Friendica\Content\Text\Markdown; use Friendica\Content\Text\Markdown;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class MarkdownTest extends FixtureTest class MarkdownTest extends FixtureTestCase
{ {
public function dataMarkdown() public function dataMarkdown()
{ {

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Content\Text;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\Plaintext; use Friendica\Content\Text\Plaintext;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class PlaintextTest extends FixtureTest class PlaintextTest extends FixtureTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -8,9 +8,9 @@
namespace Friendica\Test\src\Core; namespace Friendica\Test\src\Core;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class ACLTest extends FixtureTest class ACLTest extends FixtureTestCase
{ {
/** /**
* Test the ACL::isValidContact() function. * Test the ACL::isValidContact() function.

View file

@ -10,11 +10,11 @@ namespace Friendica\Test\src\Core\Addon\Model;
use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException; use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException;
use Friendica\Core\Addon\Model\AddonLoader; use Friendica\Core\Addon\Model\AddonLoader;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
class AddonLoaderTest extends MockedTest class AddonLoaderTest extends MockedTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -8,11 +8,12 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\Type\APCuCache; use Friendica\Core\Cache\Type\APCuCache;
use Friendica\Test\MemoryCacheTestCase;
/** /**
* @group APCU * @group APCU
*/ */
class APCuCacheTest extends MemoryCacheTest class APCuCacheTest extends MemoryCacheTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -8,8 +8,9 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\Type\ArrayCache; use Friendica\Core\Cache\Type\ArrayCache;
use Friendica\Test\MemoryCacheTestCase;
class ArrayCacheTest extends MemoryCacheTest class ArrayCacheTest extends MemoryCacheTestCase
{ {
protected function getInstance() protected function getInstance()
{ {

View file

@ -7,13 +7,13 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\App\BaseURL; use Friendica\Core\Cache\Type\DatabaseCache;
use Friendica\Core\Cache; use Friendica\Test\CacheTestCase;
use Friendica\Test\DatabaseTestTrait; use Friendica\Test\DatabaseTestTrait;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
class DatabaseCacheTest extends CacheTest class DatabaseCacheTest extends CacheTestCase
{ {
use DatabaseTestTrait; use DatabaseTestTrait;
use CreateDatabaseTrait; use CreateDatabaseTrait;
@ -30,7 +30,7 @@ class DatabaseCacheTest extends CacheTest
protected function getInstance() protected function getInstance()
{ {
$this->cache = new Cache\Type\DatabaseCache('database', $this->getDbInstance()); $this->cache = new DatabaseCache('database', $this->getDbInstance());
return $this->cache; return $this->cache;
} }

View file

@ -10,13 +10,14 @@ namespace Friendica\Test\src\Core\Cache;
use Exception; use Exception;
use Friendica\Core\Cache\Type\MemcacheCache; use Friendica\Core\Cache\Type\MemcacheCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MemoryCacheTestCase;
use Mockery; use Mockery;
/** /**
* @requires extension memcache * @requires extension memcache
* @group MEMCACHE * @group MEMCACHE
*/ */
class MemcacheCacheTest extends MemoryCacheTest class MemcacheCacheTest extends MemoryCacheTestCase
{ {
protected function getInstance() protected function getInstance()
{ {

View file

@ -10,6 +10,7 @@ namespace Friendica\Test\src\Core\Cache;
use Exception; use Exception;
use Friendica\Core\Cache\Type\MemcachedCache; use Friendica\Core\Cache\Type\MemcachedCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MemoryCacheTestCase;
use Mockery; use Mockery;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
@ -17,7 +18,7 @@ use Psr\Log\NullLogger;
* @requires extension memcached * @requires extension memcached
* @group MEMCACHED * @group MEMCACHED
*/ */
class MemcachedCacheTest extends MemoryCacheTest class MemcachedCacheTest extends MemoryCacheTestCase
{ {
protected function getInstance() protected function getInstance()
{ {

View file

@ -10,13 +10,14 @@ namespace Friendica\Test\src\Core\Cache;
use Exception; use Exception;
use Friendica\Core\Cache\Type\RedisCache; use Friendica\Core\Cache\Type\RedisCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Test\MemoryCacheTestCase;
use Mockery; use Mockery;
/** /**
* @requires extension redis * @requires extension redis
* @group REDIS * @group REDIS
*/ */
class RedisCacheTest extends MemoryCacheTest class RedisCacheTest extends MemoryCacheTestCase
{ {
protected function getInstance() protected function getInstance()
{ {
@ -44,7 +45,7 @@ class RedisCacheTest extends MemoryCacheTest
->andReturn(null); ->andReturn(null);
try { try {
$this->cache = new \Friendica\Core\Cache\Type\RedisCache($host, $configMock); $this->cache = new RedisCache($host, $configMock);
} catch (Exception $e) { } catch (Exception $e) {
static::markTestSkipped('Redis is not available. Failure: ' . $e->getMessage()); static::markTestSkipped('Redis is not available. Failure: ' . $e->getMessage());
} }

View file

@ -8,11 +8,11 @@
namespace Friendica\Test\src\Core\Config\Cache; namespace Friendica\Test\src\Core\Config\Cache;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use ParagonIE\HiddenString\HiddenString; use ParagonIE\HiddenString\HiddenString;
use stdClass; use stdClass;
class CacheTest extends MockedTest class CacheTest extends MockedTestCase
{ {
public function dataTests() public function dataTests()
{ {

View file

@ -9,12 +9,12 @@ namespace Friendica\Test\src\Core\Config\Cache;
use Friendica\Core\Config\Factory\Config; use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\Util\ConfigFileManager;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
class ConfigFileManagerTest extends MockedTest class ConfigFileManagerTest extends MockedTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -13,12 +13,12 @@ use Friendica\Core\Config\Model\DatabaseConfig;
use Friendica\Core\Config\Model\ReadOnlyFileConfig; use Friendica\Core\Config\Model\ReadOnlyFileConfig;
use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
class ConfigTest extends DatabaseTest class ConfigTest extends DatabaseTestCase
{ {
use ArraySubsetAsserts; use ArraySubsetAsserts;
use VFSTrait; use VFSTrait;

View file

@ -14,14 +14,14 @@ use Friendica\Core\Config\Model\ConfigTransaction;
use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTest;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Mockery\Exception\InvalidCountException; use Mockery\Exception\InvalidCountException;
class ConfigTransactionTest extends FixtureTest class ConfigTransactionTest extends FixtureTestCase
{ {
/** @var ConfigFileManager */ /** @var ConfigFileManager */
protected $configFileManager; protected $configFileManager;

View file

@ -12,13 +12,13 @@ use Friendica\Core\Hooks\Exceptions\HookInstanceException;
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException; use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
use Friendica\Core\Hooks\Model\DiceInstanceManager; use Friendica\Core\Hooks\Model\DiceInstanceManager;
use Friendica\Core\Hooks\Util\StrategiesFileManager; use Friendica\Core\Hooks\Util\StrategiesFileManager;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\Hooks\InstanceMocks\FakeInstance; use Friendica\Test\Util\Hooks\InstanceMocks\FakeInstance;
use Friendica\Test\Util\Hooks\InstanceMocks\FakeInstanceDecorator; use Friendica\Test\Util\Hooks\InstanceMocks\FakeInstanceDecorator;
use Friendica\Test\Util\Hooks\InstanceMocks\IAmADecoratedInterface; use Friendica\Test\Util\Hooks\InstanceMocks\IAmADecoratedInterface;
use Mockery\MockInterface; use Mockery\MockInterface;
class InstanceManagerTest extends MockedTest class InstanceManagerTest extends MockedTestCase
{ {
/** @var StrategiesFileManager|MockInterface */ /** @var StrategiesFileManager|MockInterface */
protected $hookFileManager; protected $hookFileManager;

View file

@ -11,13 +11,13 @@ use Friendica\Core\Addon\Capability\ICanLoadAddons;
use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
use Friendica\Core\Hooks\Exceptions\HookConfigException; use Friendica\Core\Hooks\Exceptions\HookConfigException;
use Friendica\Core\Hooks\Util\StrategiesFileManager; use Friendica\Core\Hooks\Util\StrategiesFileManager;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class StrategiesFileManagerTest extends MockedTest class StrategiesFileManagerTest extends MockedTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -15,13 +15,13 @@ use Friendica\Core\L10n;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses; use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests; use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Mockery; use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
use phpmock\phpunit\PHPMock; use phpmock\phpunit\PHPMock;
class InstallerTest extends MockedTest class InstallerTest extends MockedTestCase
{ {
use VFSTrait; use VFSTrait;
use ArraySubsetAsserts; use ArraySubsetAsserts;

View file

@ -10,9 +10,10 @@ namespace Friendica\Test\src\Core\KeyValueStorage;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage; use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
class DBKeyValueStorageTest extends KeyValueStorageTest class DBKeyValueStorageTest extends MockedTestCase
{ {
use CreateDatabaseTrait; use CreateDatabaseTrait;
@ -68,4 +69,79 @@ class DBKeyValueStorageTest extends KeyValueStorageTest
self::assertGreaterThanOrEqual($updateAt, $updateAtAfter); self::assertGreaterThanOrEqual($updateAt, $updateAtAfter);
} }
public function testInstance()
{
$instance = $this->getInstance();
self::assertInstanceOf(IManageKeyValuePairs::class, $instance);
}
public function dataTests(): array
{
return [
'string' => ['k' => 'data', 'v' => 'it'],
'boolTrue' => ['k' => 'data', 'v' => true],
'boolFalse' => ['k' => 'data', 'v' => false],
'integer' => ['k' => 'data', 'v' => 235],
'decimal' => ['k' => 'data', 'v' => 2.456],
'array' => ['k' => 'data', 'v' => ['1', 2, '3', true, false]],
'boolIntTrue' => ['k' => 'data', 'v' => 1],
'boolIntFalse' => ['k' => 'data', 'v' => 0],
];
}
/**
* @dataProvider dataTests
*/
public function testGetSetDelete($k, $v)
{
$instance = $this->getInstance();
$instance->set($k, $v);
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
$instance->delete($k);
self::assertNull($instance->get($k));
self::assertNull($instance[$k]);
}
/**
* @dataProvider dataTests
*/
public function testSetOverride($k, $v)
{
$instance = $this->getInstance();
$instance->set($k, $v);
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
$instance->set($k, 'another_value');
self::assertEquals('another_value', $instance->get($k));
self::assertEquals('another_value', $instance[$k]);
}
/**
* @dataProvider dataTests
*/
public function testOffsetSetDelete($k, $v)
{
$instance = $this->getInstance();
$instance[$k] = $v;
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
unset($instance[$k]);
self::assertNull($instance->get($k));
self::assertNull($instance[$k]);
}
} }

View file

@ -1,91 +0,0 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Core\KeyValueStorage;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Test\MockedTest;
abstract class KeyValueStorageTest extends MockedTest
{
abstract public function getInstance(): IManageKeyValuePairs;
public function testInstance()
{
$instance = $this->getInstance();
self::assertInstanceOf(IManageKeyValuePairs::class, $instance);
}
public function dataTests(): array
{
return [
'string' => ['k' => 'data', 'v' => 'it'],
'boolTrue' => ['k' => 'data', 'v' => true],
'boolFalse' => ['k' => 'data', 'v' => false],
'integer' => ['k' => 'data', 'v' => 235],
'decimal' => ['k' => 'data', 'v' => 2.456],
'array' => ['k' => 'data', 'v' => ['1', 2, '3', true, false]],
'boolIntTrue' => ['k' => 'data', 'v' => 1],
'boolIntFalse' => ['k' => 'data', 'v' => 0],
];
}
/**
* @dataProvider dataTests
*/
public function testGetSetDelete($k, $v)
{
$instance = $this->getInstance();
$instance->set($k, $v);
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
$instance->delete($k);
self::assertNull($instance->get($k));
self::assertNull($instance[$k]);
}
/**
* @dataProvider dataTests
*/
public function testSetOverride($k, $v)
{
$instance = $this->getInstance();
$instance->set($k, $v);
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
$instance->set($k, 'another_value');
self::assertEquals('another_value', $instance->get($k));
self::assertEquals('another_value', $instance[$k]);
}
/**
* @dataProvider dataTests
*/
public function testOffsetSetDelete($k, $v)
{
$instance = $this->getInstance();
$instance[$k] = $v;
self::assertEquals($v, $instance->get($k));
self::assertEquals($v, $instance[$k]);
unset($instance[$k]);
self::assertNull($instance->get($k));
self::assertNull($instance[$k]);
}
}

View file

@ -8,9 +8,9 @@
namespace Friendica\Test\src\Core; namespace Friendica\Test\src\Core;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class L10nTest extends MockedTest class L10nTest extends MockedTestCase
{ {
public function dataDetectLanguage() public function dataDetectLanguage()
{ {

View file

@ -9,11 +9,12 @@ namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Cache\Type\APCuCache; use Friendica\Core\Cache\Type\APCuCache;
use Friendica\Core\Lock\Type\CacheLock; use Friendica\Core\Lock\Type\CacheLock;
use Friendica\Test\LockTestCase;
/** /**
* @group APCU * @group APCU
*/ */
class APCuCacheLockTest extends LockTest class APCuCacheLockTest extends LockTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {
@ -26,6 +27,6 @@ class APCuCacheLockTest extends LockTest
protected function getInstance() protected function getInstance()
{ {
return new \Friendica\Core\Lock\Type\CacheLock(new APCuCache('localhost')); return new CacheLock(new APCuCache('localhost'));
} }
} }

View file

@ -9,12 +9,13 @@ namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Cache\Type\ArrayCache; use Friendica\Core\Cache\Type\ArrayCache;
use Friendica\Core\Lock\Type\CacheLock; use Friendica\Core\Lock\Type\CacheLock;
use Friendica\Test\LockTestCase;
class ArrayCacheLockTest extends LockTest class ArrayCacheLockTest extends LockTestCase
{ {
protected function getInstance() protected function getInstance()
{ {
return new \Friendica\Core\Lock\Type\CacheLock(new ArrayCache('localhost')); return new CacheLock(new ArrayCache('localhost'));
} }
/** /**

View file

@ -8,9 +8,10 @@
namespace Friendica\Test\src\Core\Lock; namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Lock\Type\DatabaseLock; use Friendica\Core\Lock\Type\DatabaseLock;
use Friendica\Test\LockTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
class DatabaseLockDriverTest extends LockTest class DatabaseLockDriverTest extends LockTestCase
{ {
use CreateDatabaseTrait; use CreateDatabaseTrait;

View file

@ -11,13 +11,14 @@ use Exception;
use Friendica\Core\Cache\Type\MemcacheCache; use Friendica\Core\Cache\Type\MemcacheCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Lock\Type\CacheLock; use Friendica\Core\Lock\Type\CacheLock;
use Friendica\Test\LockTestCase;
use Mockery; use Mockery;
/** /**
* @requires extension Memcache * @requires extension Memcache
* @group MEMCACHE * @group MEMCACHE
*/ */
class MemcacheCacheLockTest extends LockTest class MemcacheCacheLockTest extends LockTestCase
{ {
protected function getInstance() protected function getInstance()
{ {
@ -39,7 +40,7 @@ class MemcacheCacheLockTest extends LockTest
try { try {
$cache = new MemcacheCache($host, $configMock); $cache = new MemcacheCache($host, $configMock);
$lock = new \Friendica\Core\Lock\Type\CacheLock($cache); $lock = new CacheLock($cache);
} catch (Exception $e) { } catch (Exception $e) {
static::markTestSkipped('Memcache is not available'); static::markTestSkipped('Memcache is not available');
} }

View file

@ -11,6 +11,7 @@ use Exception;
use Friendica\Core\Cache\Type\MemcachedCache; use Friendica\Core\Cache\Type\MemcachedCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Lock\Type\CacheLock; use Friendica\Core\Lock\Type\CacheLock;
use Friendica\Test\LockTestCase;
use Mockery; use Mockery;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
@ -18,7 +19,7 @@ use Psr\Log\NullLogger;
* @requires extension memcached * @requires extension memcached
* @group MEMCACHED * @group MEMCACHED
*/ */
class MemcachedCacheLockTest extends LockTest class MemcachedCacheLockTest extends LockTestCase
{ {
protected function getInstance() protected function getInstance()
{ {

View file

@ -11,13 +11,14 @@ use Exception;
use Friendica\Core\Cache\Type\RedisCache; use Friendica\Core\Cache\Type\RedisCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Lock\Type\CacheLock; use Friendica\Core\Lock\Type\CacheLock;
use Friendica\Test\LockTestCase;
use Mockery; use Mockery;
/** /**
* @requires extension redis * @requires extension redis
* @group REDIS * @group REDIS
*/ */
class RedisCacheLockTest extends LockTest class RedisCacheLockTest extends LockTestCase
{ {
protected function getInstance() protected function getInstance()
{ {
@ -48,7 +49,7 @@ class RedisCacheLockTest extends LockTest
try { try {
$cache = new RedisCache($host, $configMock); $cache = new RedisCache($host, $configMock);
$lock = new \Friendica\Core\Lock\Type\CacheLock($cache); $lock = new CacheLock($cache);
} catch (Exception $e) { } catch (Exception $e) {
static::markTestSkipped('Redis is not available. Error: ' . $e->getMessage()); static::markTestSkipped('Redis is not available. Error: ' . $e->getMessage());
} }

View file

@ -12,12 +12,14 @@ use Friendica\App;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\Model\ReadOnlyFileConfig; use Friendica\Core\Config\Model\ReadOnlyFileConfig;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Lock\Type\SemaphoreLock;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\LockTestCase;
use Mockery; use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
class SemaphoreLockTest extends LockTest class SemaphoreLockTest extends LockTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {
@ -40,7 +42,7 @@ class SemaphoreLockTest extends LockTest
protected function getInstance() protected function getInstance()
{ {
return new \Friendica\Core\Lock\Type\SemaphoreLock(); return new SemaphoreLock();
} }
/** /**

View file

@ -7,14 +7,15 @@
namespace Friendica\Test\src\Core\Logger; namespace Friendica\Test\src\Core\Logger;
use Friendica\Test\MockedTest;
use Friendica\Core\Logger\Type\ProfilerLogger; use Friendica\Core\Logger\Type\ProfilerLogger;
use Friendica\Test\LoggerDataTrait;
use Friendica\Test\MockedTestCase;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
use Mockery\MockInterface; use Mockery\MockInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class ProfilerLoggerTest extends MockedTest class ProfilerLoggerTest extends MockedTestCase
{ {
use LoggerDataTrait; use LoggerDataTrait;

View file

@ -9,13 +9,14 @@ namespace Friendica\Test\src\Core\Logger;
use Friendica\Core\Logger\Exception\LoggerArgumentException; use Friendica\Core\Logger\Exception\LoggerArgumentException;
use Friendica\Core\Logger\Exception\LogLevelException; use Friendica\Core\Logger\Exception\LogLevelException;
use Friendica\Test\LoggerTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Friendica\Core\Logger\Type\StreamLogger; use Friendica\Core\Logger\Type\StreamLogger;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamFile; use org\bovigo\vfs\vfsStreamFile;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class StreamLoggerTest extends AbstractLoggerTest class StreamLoggerTest extends LoggerTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -9,9 +9,10 @@ namespace Friendica\Test\src\Core\Logger;
use Friendica\Core\Logger\Exception\LogLevelException; use Friendica\Core\Logger\Exception\LogLevelException;
use Friendica\Core\Logger\Type\SyslogLogger; use Friendica\Core\Logger\Type\SyslogLogger;
use Friendica\Test\LoggerTestCase;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class SyslogLoggerTest extends AbstractLoggerTest class SyslogLoggerTest extends LoggerTestCase
{ {
/** /**
* @var SyslogLoggerWrapper * @var SyslogLoggerWrapper

View file

@ -8,10 +8,10 @@
namespace Friendica\Test\src\Core\Logger; namespace Friendica\Test\src\Core\Logger;
use Friendica\Core\Logger\Type\WorkerLogger; use Friendica\Core\Logger\Type\WorkerLogger;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class WorkerLoggerTest extends MockedTest class WorkerLoggerTest extends MockedTestCase
{ {
private function assertUid($uid) private function assertUid($uid)
{ {

View file

@ -7,10 +7,9 @@
namespace Friendica\Test\src\Core\PConfig\Cache; namespace Friendica\Test\src\Core\PConfig\Cache;
use Friendica\Core\PConfig\Cache; use Friendica\Test\MockedTestCase;
use Friendica\Test\MockedTest;
class CacheTest extends MockedTest class CacheTest extends MockedTestCase
{ {
public function dataTests() public function dataTests()
{ {

View file

@ -8,8 +8,9 @@
namespace Friendica\Test\src\Core\PConfig; namespace Friendica\Test\src\Core\PConfig;
use Friendica\Core\PConfig\Type\JitPConfig; use Friendica\Core\PConfig\Type\JitPConfig;
use Friendica\Test\PConfigTestCase;
class JitPConfigTest extends PConfigTest class JitPConfigTest extends PConfigTestCase
{ {
public function getInstance() public function getInstance()
{ {

View file

@ -8,12 +8,13 @@
namespace Friendica\Test\src\Core\PConfig; namespace Friendica\Test\src\Core\PConfig;
use Friendica\Core\PConfig\Type\PreloadPConfig; use Friendica\Core\PConfig\Type\PreloadPConfig;
use Friendica\Test\PConfigTestCase;
class PreloadPConfigTest extends PConfigTest class PreloadPConfigTest extends PConfigTestCase
{ {
public function getInstance() public function getInstance()
{ {
return new \Friendica\Core\PConfig\Type\PreloadPConfig($this->configCache, $this->configModel); return new PreloadPConfig($this->configCache, $this->configModel);
} }
/** /**

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\Core\Session;
use Friendica\Core\Session\Model\UserSession; use Friendica\Core\Session\Model\UserSession;
use Friendica\Core\Session\Type\ArraySession; use Friendica\Core\Session\Type\ArraySession;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class UserSessionTest extends MockedTest class UserSessionTest extends MockedTestCase
{ {
public function dataLocalUserId() public function dataLocalUserId()
{ {

View file

@ -8,9 +8,10 @@
namespace Friendica\Test\src\Core\Storage; namespace Friendica\Test\src\Core\Storage;
use Friendica\Core\Storage\Type\Database; use Friendica\Core\Storage\Type\Database;
use Friendica\Test\StorageTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
class DatabaseStorageTest extends StorageTest class DatabaseStorageTest extends StorageTestCase
{ {
use CreateDatabaseTrait; use CreateDatabaseTrait;

View file

@ -11,11 +11,12 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Storage\Capability\ICanConfigureStorage; use Friendica\Core\Storage\Capability\ICanConfigureStorage;
use Friendica\Core\Storage\Type\FilesystemConfig; use Friendica\Core\Storage\Type\FilesystemConfig;
use Friendica\Test\StorageConfigTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use Mockery\MockInterface; use Mockery\MockInterface;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
class FilesystemStorageConfigTest extends StorageConfigTest class FilesystemStorageConfigTest extends StorageConfigTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -10,10 +10,11 @@ namespace Friendica\Test\src\Core\Storage;
use Friendica\Core\Storage\Exception\StorageException; use Friendica\Core\Storage\Exception\StorageException;
use Friendica\Core\Storage\Type\Filesystem; use Friendica\Core\Storage\Type\Filesystem;
use Friendica\Core\Storage\Type\FilesystemConfig; use Friendica\Core\Storage\Type\FilesystemConfig;
use Friendica\Test\StorageTestCase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStream;
class FilesystemStorageTest extends StorageTest class FilesystemStorageTest extends StorageTestCase
{ {
use VFSTrait; use VFSTrait;

View file

@ -26,7 +26,7 @@ use Friendica\Database\Definition\ViewDefinition;
use Friendica\DI; use Friendica\DI;
use Friendica\Core\Config\Factory\Config; use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Storage\Type; use Friendica\Core\Storage\Type;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
@ -36,7 +36,7 @@ use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
use Friendica\Test\Util\SampleStorageBackend; use Friendica\Test\Util\SampleStorageBackend;
class StorageManagerTest extends DatabaseTest class StorageManagerTest extends DatabaseTestCase
{ {
use CreateDatabaseTrait; use CreateDatabaseTrait;

View file

@ -10,10 +10,10 @@ namespace Friendica\Test\src\Core\Worker\Repository;
use Friendica\Core\Worker\Factory; use Friendica\Core\Worker\Factory;
use Friendica\Core\Worker\Repository; use Friendica\Core\Worker\Repository;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class ProcessTest extends FixtureTest class ProcessTest extends FixtureTestCase
{ {
public function testStandardProcess() public function testStandardProcess()
{ {

View file

@ -11,10 +11,10 @@ use Dice\Dice;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
class DBATest extends DatabaseTest class DBATest extends DatabaseTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -11,10 +11,10 @@ use Dice\Dice;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBStructure; use Friendica\Database\DBStructure;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTestCase;
use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\Database\StaticDatabase;
class DBStructureTest extends DatabaseTest class DBStructureTest extends DatabaseTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -9,10 +9,10 @@ namespace Friendica\Test\src\Database;
use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\CreateDatabaseTrait;
class DatabaseTest extends FixtureTest class DatabaseTest extends FixtureTestCase
{ {
use CreateDatabaseTrait; use CreateDatabaseTrait;

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\Factory\Api\Mastodon;
use Friendica\Content\Smilies; use Friendica\Content\Smilies;
use Friendica\DI; use Friendica\DI;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class EmojiTest extends FixtureTest class EmojiTest extends FixtureTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Factory\Api\Mastodon;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class StatusTest extends FixtureTest class StatusTest extends FixtureTestCase
{ {
protected $status; protected $status;

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\Factory\Api\Twitter;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Friendica\Activities; use Friendica\Factory\Api\Friendica\Activities;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTestCase;
class ActivitiesTest extends FixtureTest class ActivitiesTest extends FixtureTestCase
{ {
/** /**
* Test the api_format_items_activities() function. * Test the api_format_items_activities() function.

View file

@ -9,10 +9,10 @@ namespace Friendica\Test\src\Factory\Api\Twitter;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Test\FixtureTest; use Friendica\Test\ApiTestCase;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\FixtureTestCase;
class DirectMessageTest extends FixtureTest class DirectMessageTest extends FixtureTestCase
{ {
/** /**
* Test the api_format_messages() function. * Test the api_format_messages() function.
@ -26,7 +26,7 @@ class DirectMessageTest extends FixtureTest
$id = $ids[0]['id']; $id = $ids[0]['id'];
$directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()))
->createFromMailId($id, ApiTest::SELF_USER['id']) ->createFromMailId($id, ApiTestCase::SELF_USER['id'])
->toArray(); ->toArray();
self::assertEquals('item_title' . "\n" . 'item_body', $directMessage['text']); self::assertEquals('item_title' . "\n" . 'item_body', $directMessage['text']);
@ -49,7 +49,7 @@ class DirectMessageTest extends FixtureTest
$id = $ids[0]['id']; $id = $ids[0]['id'];
$directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()))
->createFromMailId($id, ApiTest::SELF_USER['id'], 'html') ->createFromMailId($id, ApiTestCase::SELF_USER['id'], 'html')
->toArray(); ->toArray();
self::assertEquals('item_title', $directMessage['title']); self::assertEquals('item_title', $directMessage['title']);
@ -68,7 +68,7 @@ class DirectMessageTest extends FixtureTest
$id = $ids[0]['id']; $id = $ids[0]['id'];
$directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()))
->createFromMailId($id, ApiTest::SELF_USER['id'], 'plain') ->createFromMailId($id, ApiTestCase::SELF_USER['id'], 'plain')
->toArray(); ->toArray();
self::assertEquals('item_title', $directMessage['title']); self::assertEquals('item_title', $directMessage['title']);
@ -90,7 +90,7 @@ class DirectMessageTest extends FixtureTest
$id = $ids[0]['id']; $id = $ids[0]['id'];
$directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()))
->createFromMailId($id, ApiTest::SELF_USER['id'], 'plain', $$GETUSEROBJECTS$$) ->createFromMailId($id, ApiTestCase::SELF_USER['id'], 'plain', $$GETUSEROBJECTS$$)
->toArray(); ->toArray();
self::assertTrue(!isset($directMessage['sender'])); self::assertTrue(!isset($directMessage['sender']));

View file

@ -16,10 +16,10 @@ use Friendica\Factory\Api\Twitter\Media;
use Friendica\Factory\Api\Twitter\Mention; use Friendica\Factory\Api\Twitter\Mention;
use Friendica\Factory\Api\Twitter\Status; use Friendica\Factory\Api\Twitter\Status;
use Friendica\Factory\Api\Twitter\Url; use Friendica\Factory\Api\Twitter\Url;
use Friendica\Test\FixtureTest; use Friendica\Test\ApiTestCase;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\FixtureTestCase;
class StatusTest extends FixtureTest class StatusTest extends FixtureTestCase
{ {
protected $statusFactory; protected $statusFactory;
@ -47,7 +47,7 @@ class StatusTest extends FixtureTest
public function testApiConvertItem() public function testApiConvertItem()
{ {
$status = $this->statusFactory $status = $this->statusFactory
->createFromItemId(13, ApiTest::SELF_USER['id']) ->createFromItemId(13, ApiTestCase::SELF_USER['id'])
->toArray(); ->toArray();
self::assertStringStartsWith('item_title', $status['text']); self::assertStringStartsWith('item_title', $status['text']);
@ -108,7 +108,7 @@ class StatusTest extends FixtureTest
public function testApiGetEntitiesWithIncludeEntities() public function testApiGetEntitiesWithIncludeEntities()
{ {
$status = $this->statusFactory $status = $this->statusFactory
->createFromItemId(13, ApiTest::SELF_USER['id'], true) ->createFromItemId(13, ApiTestCase::SELF_USER['id'], true)
->toArray(); ->toArray();
self::assertIsArray($status['entities']); self::assertIsArray($status['entities']);
@ -130,7 +130,7 @@ class StatusTest extends FixtureTest
$posts = DI::dba()->selectToArray('post-view', ['uri-id']); $posts = DI::dba()->selectToArray('post-view', ['uri-id']);
foreach ($posts as $item) { foreach ($posts as $item) {
$status = $this->statusFactory $status = $this->statusFactory
->createFromUriId($item['uri-id'], ApiTest::SELF_USER['id']) ->createFromUriId($item['uri-id'], ApiTestCase::SELF_USER['id'])
->toArray(); ->toArray();
self::assertIsInt($status['id']); self::assertIsInt($status['id']);

View file

@ -10,10 +10,10 @@ namespace Friendica\Test\src\Factory\Api\Twitter;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\User; use Friendica\Factory\Api\Twitter\User;
use Friendica\Network\HTTPException\NotFoundException; use Friendica\Network\HTTPException\NotFoundException;
use Friendica\Test\FixtureTest; use Friendica\Test\ApiTestCase;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\FixtureTestCase;
class UserTest extends FixtureTest class UserTest extends FixtureTestCase
{ {
/** /**
* Assert that an user array contains expected keys. * Assert that an user array contains expected keys.
@ -22,11 +22,11 @@ class UserTest extends FixtureTest
*/ */
protected function assertSelfUser(array $user) protected function assertSelfUser(array $user)
{ {
self::assertEquals(ApiTest::SELF_USER['id'], $user['uid']); self::assertEquals(ApiTestCase::SELF_USER['id'], $user['uid']);
self::assertEquals(ApiTest::SELF_USER['id'], $user['cid']); self::assertEquals(ApiTestCase::SELF_USER['id'], $user['cid']);
self::assertEquals('DFRN', $user['location']); self::assertEquals('DFRN', $user['location']);
self::assertEquals(ApiTest::SELF_USER['name'], $user['name']); self::assertEquals(ApiTestCase::SELF_USER['name'], $user['name']);
self::assertEquals(ApiTest::SELF_USER['nick'], $user['screen_name']); self::assertEquals(ApiTestCase::SELF_USER['nick'], $user['screen_name']);
self::assertTrue($user['verified']); self::assertTrue($user['verified']);
} }
@ -38,7 +38,7 @@ class UserTest extends FixtureTest
public function testApiGetUser() public function testApiGetUser()
{ {
$user = (new User(DI::logger(), DI::twitterStatus())) $user = (new User(DI::logger(), DI::twitterStatus()))
->createFromUserId(ApiTest::SELF_USER['id']) ->createFromUserId(ApiTestCase::SELF_USER['id'])
->toArray(); ->toArray();
$this->assertSelfUser($user); $this->assertSelfUser($user);
@ -54,7 +54,7 @@ class UserTest extends FixtureTest
$this->markTestIncomplete('Needs missing fields for profile colors at API User object first.'); $this->markTestIncomplete('Needs missing fields for profile colors at API User object first.');
/* /*
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'schema', 'red'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'schema', 'red');
$userFactory = new User(DI::logger(), DI::twitterStatus()); $userFactory = new User(DI::logger(), DI::twitterStatus());
$user = $userFactory->createFromUserId(42); $user = $userFactory->createFromUserId(42);
@ -76,7 +76,7 @@ class UserTest extends FixtureTest
$this->markTestIncomplete('Needs missing fields for profile colors at API User object first.'); $this->markTestIncomplete('Needs missing fields for profile colors at API User object first.');
/* /*
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'schema', '---'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'schema', '---');
$userFactory = new User(DI::logger(), DI::twitterStatus()); $userFactory = new User(DI::logger(), DI::twitterStatus());
$user = $userFactory->createFromUserId(42); $user = $userFactory->createFromUserId(42);
@ -98,10 +98,10 @@ class UserTest extends FixtureTest
$this->markTestIncomplete('Needs missing fields for profile colors at API User object first.'); $this->markTestIncomplete('Needs missing fields for profile colors at API User object first.');
/* /*
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'schema', '---'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'schema', '---');
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'nav_bg', '#123456'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'nav_bg', '#123456');
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'link_color', '#123456'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'link_color', '#123456');
DI::pConfig()->set(ApiTest::SELF_USER['id'], 'frio', 'background_color', '#123456'); DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'background_color', '#123456');
$userFactory = new User(DI::logger(), DI::twitterStatus()); $userFactory = new User(DI::logger(), DI::twitterStatus());
$user = $userFactory->createFromUserId(42); $user = $userFactory->createFromUserId(42);

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Model\Post; namespace Friendica\Test\src\Model\Post;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
class MediaTest extends MockedTest class MediaTest extends MockedTestCase
{ {
/** /**
* Test the api_get_attachments() function. * Test the api_get_attachments() function.

View file

@ -11,11 +11,11 @@ use Friendica\App\BaseURL;
use Friendica\App\Request; use Friendica\App\Request;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Model\User\Cookie; use Friendica\Model\User\Cookie;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Test\Util\StaticCookie; use Friendica\Test\Util\StaticCookie;
use Mockery\MockInterface; use Mockery\MockInterface;
class CookieTest extends MockedTest class CookieTest extends MockedTestCase
{ {
/** @var MockInterface|IManageConfigValues */ /** @var MockInterface|IManageConfigValues */
private $config; private $config;

View file

@ -11,10 +11,10 @@ use Dice\Dice;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Mockery\MockInterface; use Mockery\MockInterface;
class UserTest extends MockedTest class UserTest extends MockedTestCase
{ {
private $parent; private $parent;
private $child; private $child;

View file

@ -10,13 +10,13 @@ namespace Friendica\Test\src\Moderation\Factory;
use Friendica\Moderation\Collection; use Friendica\Moderation\Collection;
use Friendica\Moderation\Factory; use Friendica\Moderation\Factory;
use Friendica\Moderation\Entity; use Friendica\Moderation\Entity;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Friendica\Util\Clock\FrozenClock; use Friendica\Util\Clock\FrozenClock;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Psr\Clock\ClockInterface; use Psr\Clock\ClockInterface;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class ReportTest extends MockedTest class ReportTest extends MockedTestCase
{ {
public function dataCreateFromTableRow(): array public function dataCreateFromTableRow(): array
{ {

View file

@ -12,10 +12,10 @@ use Friendica\App\BaseURL;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Twitter\User; use Friendica\Factory\Api\Twitter\User;
use Friendica\Module\Api\ApiResponse; use Friendica\Module\Api\ApiResponse;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class ApiResponseTest extends MockedTest class ApiResponseTest extends MockedTestCase
{ {
public function testErrorWithJson() public function testErrorWithJson()
{ {

View file

@ -7,14 +7,13 @@
namespace Friendica\Test\src\Module\Api\Friendica\DirectMessages; namespace Friendica\Test\src\Module\Api\Friendica\DirectMessages;
use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Friendica\DirectMessages\Search; use Friendica\Module\Api\Friendica\DirectMessages\Search;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
class SearchTest extends ApiTest class SearchTest extends ApiTestCase
{ {
public function testEmpty() public function testEmpty()
{ {

View file

@ -10,11 +10,11 @@ namespace Friendica\Test\src\Module\Api\Friendica;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Friendica\Notification; use Friendica\Module\Api\Friendica\Notification;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal; use Friendica\Util\Temporal;
class NotificationTest extends ApiTest class NotificationTest extends ApiTestCase
{ {
public function testEmpty() public function testEmpty()
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Friendica\Photo\Delete; use Friendica\Module\Api\Friendica\Photo\Delete;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class DeleteTest extends ApiTest class DeleteTest extends ApiTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Delete; use Friendica\Module\Api\Friendica\Photoalbum\Delete;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class DeleteTest extends ApiTest class DeleteTest extends ApiTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Update; use Friendica\Module\Api\Friendica\Photoalbum\Update;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class UpdateTest extends ApiTest class UpdateTest extends ApiTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -9,9 +9,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\GNUSocial\GNUSocial\Config; use Friendica\Module\Api\GNUSocial\GNUSocial\Config;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class ConfigTest extends ApiTest class ConfigTest extends ApiTestCase
{ {
/** /**
* Test the api_statusnet_config() function. * Test the api_statusnet_config() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\GNUSocial\GNUSocial\Version; use Friendica\Module\Api\GNUSocial\GNUSocial\Version;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class VersionTest extends ApiTest class VersionTest extends ApiTestCase
{ {
public function test() public function test()
{ {

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\Help;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\GNUSocial\Help\Test; use Friendica\Module\Api\GNUSocial\Help\Test;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class TestTest extends ApiTest class TestTest extends ApiTestCase
{ {
public function testJson() public function testJson()
{ {

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon\Accounts; namespace Friendica\Test\src\Module\Api\Mastodon\Accounts;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class StatusesTest extends ApiTest class StatusesTest extends ApiTestCase
{ {
/** /**
* Test the api_status_show() function. * Test the api_status_show() function.

View file

@ -7,12 +7,11 @@
namespace Friendica\Test\src\Module\Api\Mastodon\Accounts; namespace Friendica\Test\src\Module\Api\Mastodon\Accounts;
use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Mastodon\Accounts\VerifyCredentials; use Friendica\Module\Api\Mastodon\Accounts\VerifyCredentials;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class VerifyCredentialsTest extends ApiTest class VerifyCredentialsTest extends ApiTestCase
{ {
/** /**
* Test the api_account_verify_credentials() function. * Test the api_account_verify_credentials() function.

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon; namespace Friendica\Test\src\Module\Api\Mastodon;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class ConversationsTest extends ApiTest class ConversationsTest extends ApiTestCase
{ {
/** /**
* Test the api_conversation_show() function. * Test the api_conversation_show() function.

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon; namespace Friendica\Test\src\Module\Api\Mastodon;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class PushSubscriptionTest extends ApiTest class PushSubscriptionTest extends ApiTestCase
{ {
/** /**
* Test the api_account_verify_credentials() function. * Test the api_account_verify_credentials() function.

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon; namespace Friendica\Test\src\Module\Api\Mastodon;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class SearchTest extends ApiTest class SearchTest extends ApiTestCase
{ {
/** /**
* Test the api_search() function. * Test the api_search() function.

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon\Timelines; namespace Friendica\Test\src\Module\Api\Mastodon\Timelines;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class HomeTest extends ApiTest class HomeTest extends ApiTestCase
{ {
/** /**
* Test the api_statuses_home_timeline() function. * Test the api_statuses_home_timeline() function.

View file

@ -7,9 +7,9 @@
namespace Friendica\Test\src\Module\Api\Mastodon\Timelines; namespace Friendica\Test\src\Module\Api\Mastodon\Timelines;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
class PublicTimelineTest extends ApiTest class PublicTimelineTest extends ApiTestCase
{ {
/** /**
* Test the api_statuses_public_timeline() function. * Test the api_statuses_public_timeline() function.

Some files were not shown because too many files have changed in this diff Show more