From b378f5b0a751996a7d9470206a4161cda06b55fb Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 11 Dec 2024 22:44:51 +0000 Subject: [PATCH 01/12] Add suffix for PHPUnit test cases --- tests/phpunit.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 0e323813f8..f163ae5bea 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -9,12 +9,12 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - functional/ - src/ - Unit/ + functional/ + src/ + Unit/ - Unit/ + Unit/ From 1d177ed907e5a77df4967ed323c58de3a475291b Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 11 Dec 2024 22:45:17 +0000 Subject: [PATCH 02/12] Rename MockedTest to MockedTestCase --- tests/DatabaseTest.php | 2 +- tests/FixtureTest.php | 16 +--------------- tests/{MockedTest.php => MockedTestCase.php} | 2 +- tests/src/App/BaseURLTest.php | 4 ++-- tests/src/App/ModeTest.php | 4 ++-- tests/src/App/RequestTest.php | 4 ++-- tests/src/CollectionTest.php | 4 ++-- tests/src/Console/ConsoleTest.php | 4 ++-- .../FriendSuggest/Factory/FriendSuggestTest.php | 4 ++-- tests/src/Content/ItemTest.php | 4 ++-- tests/src/Content/Text/BBCode/VideoTest.php | 4 ++-- tests/src/Core/Addon/Model/AddonLoaderTest.php | 4 ++-- tests/src/Core/Cache/CacheTest.php | 6 ++---- tests/src/Core/Config/Cache/CacheTest.php | 4 ++-- .../Core/Config/Cache/ConfigFileManagerTest.php | 4 ++-- .../src/Core/Hooks/Model/InstanceManagerTest.php | 4 ++-- .../Hooks/Util/StrategiesFileManagerTest.php | 4 ++-- tests/src/Core/InstallerTest.php | 4 ++-- .../Core/KeyValueStorage/KeyValueStorageTest.php | 4 ++-- tests/src/Core/L10nTest.php | 4 ++-- tests/src/Core/Lock/LockTest.php | 4 ++-- tests/src/Core/Logger/AbstractLoggerTest.php | 4 ++-- tests/src/Core/Logger/ProfilerLoggerTest.php | 4 ++-- tests/src/Core/Logger/WorkerLoggerTest.php | 4 ++-- tests/src/Core/PConfig/Cache/CacheTest.php | 5 ++--- tests/src/Core/PConfig/PConfigTest.php | 4 ++-- tests/src/Core/Session/UserSessionTest.php | 4 ++-- tests/src/Core/Storage/StorageConfigTest.php | 4 ++-- tests/src/Core/Storage/StorageTest.php | 4 ++-- tests/src/Model/Post/MediaTest.php | 4 ++-- tests/src/Model/User/CookieTest.php | 4 ++-- tests/src/Model/UserTest.php | 4 ++-- tests/src/Moderation/Factory/ReportTest.php | 4 ++-- tests/src/Module/Api/ApiResponseTest.php | 4 ++-- .../Network/HTTPClient/Client/HTTPClientTest.php | 4 ++-- tests/src/Network/ProbeTest.php | 4 ++-- .../ProfileField/Entity/ProfileFieldTest.php | 4 ++-- tests/src/Protocol/ActivityTest.php | 4 ++-- .../PermissionSet/Entity/PermissionSetTest.php | 4 ++-- .../PermissionSet/Factory/PermissionSetTest.php | 4 ++-- .../TwoFactor/Factory/TrustedBrowserTest.php | 4 ++-- .../TwoFactor/Model/TrustedBrowserTest.php | 4 ++-- tests/src/Util/BasePathTest.php | 4 ++-- tests/src/Util/DateTimeFormatTest.php | 4 ++-- tests/src/Util/EMailerTest.php | 4 ++-- tests/src/Util/Emailer/MailBuilderTest.php | 4 ++-- tests/src/Util/Emailer/SystemMailBuilderTest.php | 4 ++-- tests/src/Util/HTTPInputDataTest.php | 5 ++--- tests/src/Util/ImagesTest.php | 4 ++-- tests/src/Util/ProfilerTest.php | 4 ++-- .../Util/Router/FriendicaGroupCountBasedTest.php | 4 ++-- 51 files changed, 99 insertions(+), 117 deletions(-) rename tests/{MockedTest.php => MockedTestCase.php} (88%) diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 4510a48034..af6e45226a 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -10,7 +10,7 @@ namespace Friendica\Test; /** * Abstract class used by tests that need a database. */ -abstract class DatabaseTest extends MockedTest +abstract class DatabaseTest extends MockedTestCase { use DatabaseTestTrait; diff --git a/tests/FixtureTest.php b/tests/FixtureTest.php index 2b4bcc1329..411662e0cb 100644 --- a/tests/FixtureTest.php +++ b/tests/FixtureTest.php @@ -7,24 +7,10 @@ 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 +abstract class FixtureTest extends MockedTestCase { use FixtureTestTrait; diff --git a/tests/MockedTest.php b/tests/MockedTestCase.php similarity index 88% rename from tests/MockedTest.php rename to tests/MockedTestCase.php index 14328f830e..3fbb1b906a 100644 --- a/tests/MockedTest.php +++ b/tests/MockedTestCase.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; /** * This class verifies each mock after each call */ -abstract class MockedTest extends TestCase +abstract class MockedTestCase extends TestCase { protected function tearDown() : void { diff --git a/tests/src/App/BaseURLTest.php b/tests/src/App/BaseURLTest.php index 1e6c799f32..9c3333feff 100644 --- a/tests/src/App/BaseURLTest.php +++ b/tests/src/App/BaseURLTest.php @@ -11,10 +11,10 @@ use Friendica\App\BaseURL; use Friendica\Core\Config\Model\ReadOnlyFileConfig; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Network\HTTPException\InternalServerErrorException; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Psr\Log\NullLogger; -class BaseURLTest extends MockedTest +class BaseURLTest extends MockedTestCase { public function dataSystemUrl(): array { diff --git a/tests/src/App/ModeTest.php b/tests/src/App/ModeTest.php index 6b83775883..b1ddca1d33 100644 --- a/tests/src/App/ModeTest.php +++ b/tests/src/App/ModeTest.php @@ -12,13 +12,13 @@ use Friendica\App\Arguments; use Friendica\App\Mode; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Database\Database; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use Friendica\Util\BasePath; use Mockery; use Mockery\MockInterface; -class ModeTest extends MockedTest +class ModeTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/App/RequestTest.php b/tests/src/App/RequestTest.php index 77d77c3ba9..648d2b6386 100644 --- a/tests/src/App/RequestTest.php +++ b/tests/src/App/RequestTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\App; use Friendica\App\Request; 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 { diff --git a/tests/src/CollectionTest.php b/tests/src/CollectionTest.php index 257ec0e107..f82bb5dfea 100644 --- a/tests/src/CollectionTest.php +++ b/tests/src/CollectionTest.php @@ -7,11 +7,11 @@ namespace Friendica\Test\src; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\CollectionDouble; use Friendica\Test\Util\EntityDouble; -class CollectionTest extends MockedTest +class CollectionTest extends MockedTestCase { /** * Test if the BaseCollection::column() works as expected diff --git a/tests/src/Console/ConsoleTest.php b/tests/src/Console/ConsoleTest.php index 88c80d7bc6..5384076c73 100644 --- a/tests/src/Console/ConsoleTest.php +++ b/tests/src/Console/ConsoleTest.php @@ -8,10 +8,10 @@ namespace Friendica\Test\src\Console; use Asika\SimpleConsole\Console; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\Intercept; -abstract class ConsoleTest extends MockedTest +abstract class ConsoleTest extends MockedTestCase { /** * @var array The default argv for a Console Instance diff --git a/tests/src/Contact/FriendSuggest/Factory/FriendSuggestTest.php b/tests/src/Contact/FriendSuggest/Factory/FriendSuggestTest.php index 67275abe35..dd4102d0ab 100644 --- a/tests/src/Contact/FriendSuggest/Factory/FriendSuggestTest.php +++ b/tests/src/Contact/FriendSuggest/Factory/FriendSuggestTest.php @@ -9,10 +9,10 @@ namespace Friendica\Test\src\Contact\FriendSuggest\Factory; use Friendica\Contact\FriendSuggest\Factory\FriendSuggest; use Friendica\Contact\FriendSuggest\Entity; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Psr\Log\NullLogger; -class FriendSuggestTest extends MockedTest +class FriendSuggestTest extends MockedTestCase { public function dataCreate() { diff --git a/tests/src/Content/ItemTest.php b/tests/src/Content/ItemTest.php index a2e14ce061..c2adbccb15 100644 --- a/tests/src/Content/ItemTest.php +++ b/tests/src/Content/ItemTest.php @@ -7,9 +7,9 @@ namespace Friendica\Test\src\Content; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -class ItemTest extends MockedTest +class ItemTest extends MockedTestCase { /** * @doesNotPerformAssertions diff --git a/tests/src/Content/Text/BBCode/VideoTest.php b/tests/src/Content/Text/BBCode/VideoTest.php index 21b4d5068d..a2b4188d38 100644 --- a/tests/src/Content/Text/BBCode/VideoTest.php +++ b/tests/src/Content/Text/BBCode/VideoTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Content\Text\BBCode; 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() { diff --git a/tests/src/Core/Addon/Model/AddonLoaderTest.php b/tests/src/Core/Addon/Model/AddonLoaderTest.php index 6c052230a6..1c119fb680 100644 --- a/tests/src/Core/Addon/Model/AddonLoaderTest.php +++ b/tests/src/Core/Addon/Model/AddonLoaderTest.php @@ -10,11 +10,11 @@ namespace Friendica\Test\src\Core\Addon\Model; use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException; use Friendica\Core\Addon\Model\AddonLoader; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use org\bovigo\vfs\vfsStream; -class AddonLoaderTest extends MockedTest +class AddonLoaderTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/Core/Cache/CacheTest.php b/tests/src/Core/Cache/CacheTest.php index 10cade17d9..47c5a7ccca 100644 --- a/tests/src/Core/Cache/CacheTest.php +++ b/tests/src/Core/Cache/CacheTest.php @@ -8,12 +8,10 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\Core\Cache\Capability\ICanCache; -use Friendica\Core\Cache\Capability\ICanCacheInMemory; -use Friendica\Core\Cache\Type\AbstractCache; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\PidFile; -abstract class CacheTest extends MockedTest +abstract class CacheTest extends MockedTestCase { /** * @var int Start time of the mock (used for time operations) diff --git a/tests/src/Core/Config/Cache/CacheTest.php b/tests/src/Core/Config/Cache/CacheTest.php index f539dc045c..fddf621bd0 100644 --- a/tests/src/Core/Config/Cache/CacheTest.php +++ b/tests/src/Core/Config/Cache/CacheTest.php @@ -8,11 +8,11 @@ namespace Friendica\Test\src\Core\Config\Cache; use Friendica\Core\Config\ValueObject\Cache; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use ParagonIE\HiddenString\HiddenString; use stdClass; -class CacheTest extends MockedTest +class CacheTest extends MockedTestCase { public function dataTests() { diff --git a/tests/src/Core/Config/Cache/ConfigFileManagerTest.php b/tests/src/Core/Config/Cache/ConfigFileManagerTest.php index 3f49e8c8eb..e5b1fc623d 100644 --- a/tests/src/Core/Config/Cache/ConfigFileManagerTest.php +++ b/tests/src/Core/Config/Cache/ConfigFileManagerTest.php @@ -9,12 +9,12 @@ namespace Friendica\Test\src\Core\Config\Cache; use Friendica\Core\Config\Factory\Config; use Friendica\Core\Config\ValueObject\Cache; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use Friendica\Core\Config\Util\ConfigFileManager; use org\bovigo\vfs\vfsStream; -class ConfigFileManagerTest extends MockedTest +class ConfigFileManagerTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/Core/Hooks/Model/InstanceManagerTest.php b/tests/src/Core/Hooks/Model/InstanceManagerTest.php index 4d38265ebf..ef22218945 100644 --- a/tests/src/Core/Hooks/Model/InstanceManagerTest.php +++ b/tests/src/Core/Hooks/Model/InstanceManagerTest.php @@ -12,13 +12,13 @@ use Friendica\Core\Hooks\Exceptions\HookInstanceException; use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException; use Friendica\Core\Hooks\Model\DiceInstanceManager; 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\FakeInstanceDecorator; use Friendica\Test\Util\Hooks\InstanceMocks\IAmADecoratedInterface; use Mockery\MockInterface; -class InstanceManagerTest extends MockedTest +class InstanceManagerTest extends MockedTestCase { /** @var StrategiesFileManager|MockInterface */ protected $hookFileManager; diff --git a/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php b/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php index 5fb0927d68..633b636701 100644 --- a/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php +++ b/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php @@ -11,13 +11,13 @@ use Friendica\Core\Addon\Capability\ICanLoadAddons; use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Exceptions\HookConfigException; use Friendica\Core\Hooks\Util\StrategiesFileManager; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use org\bovigo\vfs\vfsStream; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -class StrategiesFileManagerTest extends MockedTest +class StrategiesFileManagerTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/Core/InstallerTest.php b/tests/src/Core/InstallerTest.php index a97c7d36c9..2f5873dfe6 100644 --- a/tests/src/Core/InstallerTest.php +++ b/tests/src/Core/InstallerTest.php @@ -15,13 +15,13 @@ use Friendica\Core\L10n; use Friendica\DI; use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses; use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use Mockery; use Mockery\MockInterface; use phpmock\phpunit\PHPMock; -class InstallerTest extends MockedTest +class InstallerTest extends MockedTestCase { use VFSTrait; use ArraySubsetAsserts; diff --git a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php index 6d1f6ad328..123be61e12 100644 --- a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php +++ b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Core\KeyValueStorage; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -abstract class KeyValueStorageTest extends MockedTest +abstract class KeyValueStorageTest extends MockedTestCase { abstract public function getInstance(): IManageKeyValuePairs; diff --git a/tests/src/Core/L10nTest.php b/tests/src/Core/L10nTest.php index cf61b2dd48..01dc301d78 100644 --- a/tests/src/Core/L10nTest.php +++ b/tests/src/Core/L10nTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Core; use Friendica\Core\L10n; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -class L10nTest extends MockedTest +class L10nTest extends MockedTestCase { public function dataDetectLanguage() { diff --git a/tests/src/Core/Lock/LockTest.php b/tests/src/Core/Lock/LockTest.php index 4c8583523a..c32f50e2f6 100644 --- a/tests/src/Core/Lock/LockTest.php +++ b/tests/src/Core/Lock/LockTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Core\Lock; use Friendica\Core\Lock\Capability\ICanLock; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -abstract class LockTest extends MockedTest +abstract class LockTest extends MockedTestCase { /** * @var int Start time of the mock (used for time operations) diff --git a/tests/src/Core/Logger/AbstractLoggerTest.php b/tests/src/Core/Logger/AbstractLoggerTest.php index a155239a8d..b1a793d41f 100644 --- a/tests/src/Core/Logger/AbstractLoggerTest.php +++ b/tests/src/Core/Logger/AbstractLoggerTest.php @@ -8,13 +8,13 @@ namespace Friendica\Test\src\Core\Logger; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Test\MockedTest; use Friendica\Core\Logger\Util\Introspection; +use Friendica\Test\MockedTestCase; use Mockery\MockInterface; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; -abstract class AbstractLoggerTest extends MockedTest +abstract class AbstractLoggerTest extends MockedTestCase { use LoggerDataTrait; diff --git a/tests/src/Core/Logger/ProfilerLoggerTest.php b/tests/src/Core/Logger/ProfilerLoggerTest.php index b6dd4c4132..9ae1d5b3ef 100644 --- a/tests/src/Core/Logger/ProfilerLoggerTest.php +++ b/tests/src/Core/Logger/ProfilerLoggerTest.php @@ -7,14 +7,14 @@ namespace Friendica\Test\src\Core\Logger; -use Friendica\Test\MockedTest; use Friendica\Core\Logger\Type\ProfilerLogger; +use Friendica\Test\MockedTestCase; use Friendica\Util\Profiler; use Mockery\MockInterface; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; -class ProfilerLoggerTest extends MockedTest +class ProfilerLoggerTest extends MockedTestCase { use LoggerDataTrait; diff --git a/tests/src/Core/Logger/WorkerLoggerTest.php b/tests/src/Core/Logger/WorkerLoggerTest.php index d40cf82f09..ab3e41d9d1 100644 --- a/tests/src/Core/Logger/WorkerLoggerTest.php +++ b/tests/src/Core/Logger/WorkerLoggerTest.php @@ -8,10 +8,10 @@ namespace Friendica\Test\src\Core\Logger; use Friendica\Core\Logger\Type\WorkerLogger; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Psr\Log\LoggerInterface; -class WorkerLoggerTest extends MockedTest +class WorkerLoggerTest extends MockedTestCase { private function assertUid($uid) { diff --git a/tests/src/Core/PConfig/Cache/CacheTest.php b/tests/src/Core/PConfig/Cache/CacheTest.php index 50b2b3f205..a4d968730b 100644 --- a/tests/src/Core/PConfig/Cache/CacheTest.php +++ b/tests/src/Core/PConfig/Cache/CacheTest.php @@ -7,10 +7,9 @@ namespace Friendica\Test\src\Core\PConfig\Cache; -use Friendica\Core\PConfig\Cache; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -class CacheTest extends MockedTest +class CacheTest extends MockedTestCase { public function dataTests() { diff --git a/tests/src/Core/PConfig/PConfigTest.php b/tests/src/Core/PConfig/PConfigTest.php index 6c2beb0068..944f7e5ade 100644 --- a/tests/src/Core/PConfig/PConfigTest.php +++ b/tests/src/Core/PConfig/PConfigTest.php @@ -11,11 +11,11 @@ use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use Friendica\Core\PConfig\Type\AbstractPConfigValues; use Friendica\Core\PConfig\Repository\PConfig as PConfigModel; use Friendica\Core\PConfig\ValueObject\Cache; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Mockery; use Mockery\MockInterface; -abstract class PConfigTest extends MockedTest +abstract class PConfigTest extends MockedTestCase { use ArraySubsetAsserts; diff --git a/tests/src/Core/Session/UserSessionTest.php b/tests/src/Core/Session/UserSessionTest.php index d7db99fa81..64c7d8b950 100644 --- a/tests/src/Core/Session/UserSessionTest.php +++ b/tests/src/Core/Session/UserSessionTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Core\Session; use Friendica\Core\Session\Model\UserSession; 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() { diff --git a/tests/src/Core/Storage/StorageConfigTest.php b/tests/src/Core/Storage/StorageConfigTest.php index 23cc54df90..78a5e396f6 100644 --- a/tests/src/Core/Storage/StorageConfigTest.php +++ b/tests/src/Core/Storage/StorageConfigTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Core\Storage; use Friendica\Core\Storage\Capability\ICanConfigureStorage; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -abstract class StorageConfigTest extends MockedTest +abstract class StorageConfigTest extends MockedTestCase { /** @return ICanConfigureStorage */ abstract protected function getInstance(); diff --git a/tests/src/Core/Storage/StorageTest.php b/tests/src/Core/Storage/StorageTest.php index 10114c2dd9..9816db914c 100644 --- a/tests/src/Core/Storage/StorageTest.php +++ b/tests/src/Core/Storage/StorageTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Core\Storage; use Friendica\Core\Storage\Capability\ICanReadFromStorage; use Friendica\Core\Storage\Capability\ICanWriteToStorage; use Friendica\Core\Storage\Exception\ReferenceStorageException; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -abstract class StorageTest extends MockedTest +abstract class StorageTest extends MockedTestCase { /** @return ICanWriteToStorage */ abstract protected function getInstance(); diff --git a/tests/src/Model/Post/MediaTest.php b/tests/src/Model/Post/MediaTest.php index e6b09e6a74..d063399b13 100644 --- a/tests/src/Model/Post/MediaTest.php +++ b/tests/src/Model/Post/MediaTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Model/User/CookieTest.php b/tests/src/Model/User/CookieTest.php index 3d93e1fa37..3c56a89668 100644 --- a/tests/src/Model/User/CookieTest.php +++ b/tests/src/Model/User/CookieTest.php @@ -11,11 +11,11 @@ use Friendica\App\BaseURL; use Friendica\App\Request; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Model\User\Cookie; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\StaticCookie; use Mockery\MockInterface; -class CookieTest extends MockedTest +class CookieTest extends MockedTestCase { /** @var MockInterface|IManageConfigValues */ private $config; diff --git a/tests/src/Model/UserTest.php b/tests/src/Model/UserTest.php index 3bdd6c403e..f58f34995f 100644 --- a/tests/src/Model/UserTest.php +++ b/tests/src/Model/UserTest.php @@ -11,10 +11,10 @@ use Dice\Dice; use Friendica\Database\Database; use Friendica\DI; use Friendica\Model\User; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Mockery\MockInterface; -class UserTest extends MockedTest +class UserTest extends MockedTestCase { private $parent; private $child; diff --git a/tests/src/Moderation/Factory/ReportTest.php b/tests/src/Moderation/Factory/ReportTest.php index 46b9275d83..d488648e92 100644 --- a/tests/src/Moderation/Factory/ReportTest.php +++ b/tests/src/Moderation/Factory/ReportTest.php @@ -10,13 +10,13 @@ namespace Friendica\Test\src\Moderation\Factory; use Friendica\Moderation\Collection; use Friendica\Moderation\Factory; use Friendica\Moderation\Entity; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\Clock\FrozenClock; use Friendica\Util\DateTimeFormat; use Psr\Clock\ClockInterface; use Psr\Log\NullLogger; -class ReportTest extends MockedTest +class ReportTest extends MockedTestCase { public function dataCreateFromTableRow(): array { diff --git a/tests/src/Module/Api/ApiResponseTest.php b/tests/src/Module/Api/ApiResponseTest.php index 2133ab487c..23cc4bf702 100644 --- a/tests/src/Module/Api/ApiResponseTest.php +++ b/tests/src/Module/Api/ApiResponseTest.php @@ -12,10 +12,10 @@ use Friendica\App\BaseURL; use Friendica\Core\L10n; use Friendica\Factory\Api\Twitter\User; use Friendica\Module\Api\ApiResponse; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Psr\Log\NullLogger; -class ApiResponseTest extends MockedTest +class ApiResponseTest extends MockedTestCase { public function testErrorWithJson() { diff --git a/tests/src/Network/HTTPClient/Client/HTTPClientTest.php b/tests/src/Network/HTTPClient/Client/HTTPClientTest.php index 9a488f0d1e..bd15a7120d 100644 --- a/tests/src/Network/HTTPClient/Client/HTTPClientTest.php +++ b/tests/src/Network/HTTPClient/Client/HTTPClientTest.php @@ -9,11 +9,11 @@ namespace Friendica\Test\src\Network\HTTPClient\Client; use Friendica\DI; use Friendica\Test\DiceHttpMockHandlerTrait; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Psr7\Response; -class HTTPClientTest extends MockedTest +class HTTPClientTest extends MockedTestCase { use DiceHttpMockHandlerTrait; diff --git a/tests/src/Network/ProbeTest.php b/tests/src/Network/ProbeTest.php index d5698e33bf..653cc0ca62 100644 --- a/tests/src/Network/ProbeTest.php +++ b/tests/src/Network/ProbeTest.php @@ -9,10 +9,10 @@ namespace Friendica\Test\src\Network; use Friendica\Network\Probe; use Friendica\Test\DiceHttpMockHandlerTrait; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use GuzzleHttp\Middleware; -class ProbeTest extends MockedTest +class ProbeTest extends MockedTestCase { use DiceHttpMockHandlerTrait; diff --git a/tests/src/Profile/ProfileField/Entity/ProfileFieldTest.php b/tests/src/Profile/ProfileField/Entity/ProfileFieldTest.php index b8e5309421..e718eebf07 100644 --- a/tests/src/Profile/ProfileField/Entity/ProfileFieldTest.php +++ b/tests/src/Profile/ProfileField/Entity/ProfileFieldTest.php @@ -13,13 +13,13 @@ use Friendica\Profile\ProfileField\Exception\UnexpectedPermissionSetException; use Friendica\Profile\ProfileField\Factory\ProfileField as ProfileFieldFactory; use Friendica\Security\PermissionSet\Repository\PermissionSet as PermissionSetRepository; use Friendica\Security\PermissionSet\Factory\PermissionSet as PermissionSetFactory; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\ACLFormatter; use Friendica\Util\DateTimeFormat; use Mockery\MockInterface; use Psr\Log\NullLogger; -class ProfileFieldTest extends MockedTest +class ProfileFieldTest extends MockedTestCase { /** @var MockInterface|PermissionSetRepository */ protected $permissionSetRepository; diff --git a/tests/src/Protocol/ActivityTest.php b/tests/src/Protocol/ActivityTest.php index 59a650ea16..30359321cf 100644 --- a/tests/src/Protocol/ActivityTest.php +++ b/tests/src/Protocol/ActivityTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Protocol; use Friendica\Protocol\Activity; use Friendica\Protocol\ActivityNamespace; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -class ActivityTest extends MockedTest +class ActivityTest extends MockedTestCase { public function dataMatch() { diff --git a/tests/src/Security/PermissionSet/Entity/PermissionSetTest.php b/tests/src/Security/PermissionSet/Entity/PermissionSetTest.php index 4ed62f2fc4..bb456d0445 100644 --- a/tests/src/Security/PermissionSet/Entity/PermissionSetTest.php +++ b/tests/src/Security/PermissionSet/Entity/PermissionSetTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Security\PermissionSet\Entity; use Friendica\Security\PermissionSet\Entity\PermissionSet; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; -class PermissionSetTest extends MockedTest +class PermissionSetTest extends MockedTestCase { public function dateAllowedContacts() { diff --git a/tests/src/Security/PermissionSet/Factory/PermissionSetTest.php b/tests/src/Security/PermissionSet/Factory/PermissionSetTest.php index 8b4410217e..25ff93cbbd 100644 --- a/tests/src/Security/PermissionSet/Factory/PermissionSetTest.php +++ b/tests/src/Security/PermissionSet/Factory/PermissionSetTest.php @@ -8,11 +8,11 @@ namespace Friendica\Test\src\Security\PermissionSet\Factory; use Friendica\Security\PermissionSet\Factory\PermissionSet; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\ACLFormatter; use Psr\Log\NullLogger; -class PermissionSetTest extends MockedTest +class PermissionSetTest extends MockedTestCase { /** @var PermissionSet */ protected $permissionSet; diff --git a/tests/src/Security/TwoFactor/Factory/TrustedBrowserTest.php b/tests/src/Security/TwoFactor/Factory/TrustedBrowserTest.php index b03d14ca81..fdf2722367 100644 --- a/tests/src/Security/TwoFactor/Factory/TrustedBrowserTest.php +++ b/tests/src/Security/TwoFactor/Factory/TrustedBrowserTest.php @@ -8,12 +8,12 @@ namespace Friendica\Test\src\Security\TwoFactor\Factory; use Friendica\Security\TwoFactor\Factory\TrustedBrowser; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; use Psr\Log\NullLogger; -class TrustedBrowserTest extends MockedTest +class TrustedBrowserTest extends MockedTestCase { public function testCreateFromTableRowSuccess() { diff --git a/tests/src/Security/TwoFactor/Model/TrustedBrowserTest.php b/tests/src/Security/TwoFactor/Model/TrustedBrowserTest.php index 486fca2c0f..08f12f562a 100644 --- a/tests/src/Security/TwoFactor/Model/TrustedBrowserTest.php +++ b/tests/src/Security/TwoFactor/Model/TrustedBrowserTest.php @@ -8,11 +8,11 @@ namespace Friendica\Test\src\Security\TwoFactor\Model; use Friendica\Security\TwoFactor\Model\TrustedBrowser; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; -class TrustedBrowserTest extends MockedTest +class TrustedBrowserTest extends MockedTestCase { public function test__construct() { diff --git a/tests/src/Util/BasePathTest.php b/tests/src/Util/BasePathTest.php index 6e6eb58906..bbcaeb359b 100644 --- a/tests/src/Util/BasePathTest.php +++ b/tests/src/Util/BasePathTest.php @@ -7,10 +7,10 @@ namespace Friendica\Test\src\Util; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\BasePath; -class BasePathTest extends MockedTest +class BasePathTest extends MockedTestCase { public function dataPaths() { diff --git a/tests/src/Util/DateTimeFormatTest.php b/tests/src/Util/DateTimeFormatTest.php index 5f5e1485fc..9137659ba8 100644 --- a/tests/src/Util/DateTimeFormatTest.php +++ b/tests/src/Util/DateTimeFormatTest.php @@ -7,10 +7,10 @@ namespace Friendica\Test\src\Util; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\DateTimeFormat; -class DateTimeFormatTest extends MockedTest +class DateTimeFormatTest extends MockedTestCase { public function dataYearMonth() { diff --git a/tests/src/Util/EMailerTest.php b/tests/src/Util/EMailerTest.php index 5a892597f4..21c7fbabc2 100644 --- a/tests/src/Util/EMailerTest.php +++ b/tests/src/Util/EMailerTest.php @@ -12,7 +12,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Object\EMail\IEmail; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\EmailerSpy; use Friendica\Test\Util\HookMockTrait; use Friendica\Test\Util\SampleMailBuilder; @@ -26,7 +26,7 @@ use Psr\Log\NullLogger; * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ -class EMailerTest extends MockedTest +class EMailerTest extends MockedTestCase { use VFSTrait; use HookMockTrait; diff --git a/tests/src/Util/Emailer/MailBuilderTest.php b/tests/src/Util/Emailer/MailBuilderTest.php index 0c432e8930..36095a5d60 100644 --- a/tests/src/Util/Emailer/MailBuilderTest.php +++ b/tests/src/Util/Emailer/MailBuilderTest.php @@ -12,7 +12,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Friendica\Network\HTTPException\UnprocessableEntityException; use Friendica\Object\EMail\IEmail; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\SampleMailBuilder; use Friendica\Test\Util\VFSTrait; use Friendica\Util\EMailer\MailBuilder; @@ -23,7 +23,7 @@ use Psr\Log\NullLogger; * This class tests the "MailBuilder" (@see MailBuilder ) * Since it's an abstract class and every extended class of it has dependencies, we use a "SampleMailBuilder" (@see SampleMailBuilder ) to make this class work */ -class MailBuilderTest extends MockedTest +class MailBuilderTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/Util/Emailer/SystemMailBuilderTest.php b/tests/src/Util/Emailer/SystemMailBuilderTest.php index 380c8f523a..400f6b66c2 100644 --- a/tests/src/Util/Emailer/SystemMailBuilderTest.php +++ b/tests/src/Util/Emailer/SystemMailBuilderTest.php @@ -10,13 +10,13 @@ namespace Friendica\Test\src\Util\Emailer; use Friendica\App\BaseURL; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\VFSTrait; use Friendica\Util\EMailer\MailBuilder; use Friendica\Util\EMailer\SystemMailBuilder; use Psr\Log\NullLogger; -class SystemMailBuilderTest extends MockedTest +class SystemMailBuilderTest extends MockedTestCase { use VFSTrait; diff --git a/tests/src/Util/HTTPInputDataTest.php b/tests/src/Util/HTTPInputDataTest.php index cff535e99d..680f24ae2e 100644 --- a/tests/src/Util/HTTPInputDataTest.php +++ b/tests/src/Util/HTTPInputDataTest.php @@ -7,16 +7,15 @@ namespace Friendica\Test\src\Util; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Test\Util\HTTPInputDataDouble; -use Friendica\Util\HTTPInputData; /** * Testing HTTPInputData * * @see HTTPInputData */ -class HTTPInputDataTest extends MockedTest +class HTTPInputDataTest extends MockedTestCase { /** * Returns the data stream for the unit test diff --git a/tests/src/Util/ImagesTest.php b/tests/src/Util/ImagesTest.php index de8d317da6..b8449d3495 100644 --- a/tests/src/Util/ImagesTest.php +++ b/tests/src/Util/ImagesTest.php @@ -9,12 +9,12 @@ namespace Friendica\Test\src\Util; use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use Friendica\Test\DiceHttpMockHandlerTrait; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\Images; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Psr7\Response; -class ImagesTest extends MockedTest +class ImagesTest extends MockedTestCase { use DiceHttpMockHandlerTrait; use ArraySubsetAsserts; diff --git a/tests/src/Util/ProfilerTest.php b/tests/src/Util/ProfilerTest.php index 26870e1ea7..6e190175cb 100644 --- a/tests/src/Util/ProfilerTest.php +++ b/tests/src/Util/ProfilerTest.php @@ -8,12 +8,12 @@ namespace Friendica\Test\src\Util; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\Profiler; use Mockery\MockInterface; use Psr\Log\LoggerInterface; -class ProfilerTest extends MockedTest +class ProfilerTest extends MockedTestCase { /** * @var LoggerInterface|MockInterface diff --git a/tests/src/Util/Router/FriendicaGroupCountBasedTest.php b/tests/src/Util/Router/FriendicaGroupCountBasedTest.php index 27494d1191..d2440268d5 100644 --- a/tests/src/Util/Router/FriendicaGroupCountBasedTest.php +++ b/tests/src/Util/Router/FriendicaGroupCountBasedTest.php @@ -11,10 +11,10 @@ use FastRoute\DataGenerator\GroupCountBased; use FastRoute\RouteCollector; use FastRoute\RouteParser\Std; use Friendica\Module\Special\Options; -use Friendica\Test\MockedTest; +use Friendica\Test\MockedTestCase; use Friendica\Util\Router\FriendicaGroupCountBased; -class FriendicaGroupCountBasedTest extends MockedTest +class FriendicaGroupCountBasedTest extends MockedTestCase { public function testOptions() { From c00a7c571af2e47e1b439554f4ac5bcc2057f661 Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 13 Dec 2024 22:04:16 +0000 Subject: [PATCH 03/12] rename FixtureTest to FixtureTestCase --- tests/{FixtureTest.php => FixtureTestCase.php} | 2 +- tests/functional/DependencyCheckTest.php | 4 ++-- tests/src/Content/SmiliesTest.php | 4 ++-- tests/src/Content/Text/BBCodeTest.php | 4 ++-- tests/src/Content/Text/HTMLTest.php | 4 ++-- tests/src/Content/Text/MarkdownTest.php | 4 ++-- tests/src/Content/Text/PlaintextTest.php | 4 ++-- tests/src/Core/ACLTest.php | 4 ++-- tests/src/Core/Config/ConfigTransactionTest.php | 4 ++-- tests/src/Core/Worker/Repository/ProcessTest.php | 4 ++-- tests/src/Database/DatabaseTest.php | 4 ++-- tests/src/Factory/Api/Mastodon/EmojiTest.php | 4 ++-- tests/src/Factory/Api/Mastodon/StatusTest.php | 4 ++-- tests/src/Factory/Api/Twitter/ActivitiesTest.php | 4 ++-- tests/src/Factory/Api/Twitter/DirectMessageTest.php | 4 ++-- tests/src/Factory/Api/Twitter/StatusTest.php | 4 ++-- tests/src/Factory/Api/Twitter/UserTest.php | 4 ++-- tests/src/Module/Api/ApiTest.php | 4 ++-- tests/src/Module/Api/Twitter/ContactEndpointTest.php | 4 ++-- tests/src/Module/NodeInfoTest.php | 4 ++-- tests/src/Module/Special/OptionsTest.php | 4 ++-- tests/src/Navigation/Notifications/Entity/NotifyTest.php | 4 ++-- .../src/Profile/ProfileField/Repository/ProfileFieldTest.php | 4 ++-- tests/src/Protocol/ActivityPub/TransmitterTest.php | 4 ++-- .../Security/PermissionSet/Repository/PermissionSetTest.php | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) rename tests/{FixtureTest.php => FixtureTestCase.php} (89%) diff --git a/tests/FixtureTest.php b/tests/FixtureTestCase.php similarity index 89% rename from tests/FixtureTest.php rename to tests/FixtureTestCase.php index 411662e0cb..5fa751c871 100644 --- a/tests/FixtureTest.php +++ b/tests/FixtureTestCase.php @@ -10,7 +10,7 @@ namespace Friendica\Test; /** * Parent class for test cases requiring fixtures */ -abstract class FixtureTest extends MockedTestCase +abstract class FixtureTestCase extends MockedTestCase { use FixtureTestTrait; diff --git a/tests/functional/DependencyCheckTest.php b/tests/functional/DependencyCheckTest.php index 55412045ae..866380fbdf 100644 --- a/tests/functional/DependencyCheckTest.php +++ b/tests/functional/DependencyCheckTest.php @@ -14,12 +14,12 @@ use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Lock\Capability\ICanLock; use Friendica\Database\Database; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Util\BasePath; use Friendica\Core\Config\Util\ConfigFileManager; use Psr\Log\LoggerInterface; -class DependencyCheckTest extends FixtureTest +class DependencyCheckTest extends FixtureTestCase { protected function setUp() : void { diff --git a/tests/src/Content/SmiliesTest.php b/tests/src/Content/SmiliesTest.php index 077875def2..441176fd73 100644 --- a/tests/src/Content/SmiliesTest.php +++ b/tests/src/Content/SmiliesTest.php @@ -11,9 +11,9 @@ use Friendica\Content\Smilies; use Friendica\Core\Hook; use Friendica\DI; 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 { diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 0c55c97c77..6d6c610762 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -10,10 +10,10 @@ namespace Friendica\Test\src\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\DI; use Friendica\Network\HTTPException\InternalServerErrorException; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Util\Strings; -class BBCodeTest extends FixtureTest +class BBCodeTest extends FixtureTestCase { /** @var \HTMLPurifier */ public $HTMLPurifier; diff --git a/tests/src/Content/Text/HTMLTest.php b/tests/src/Content/Text/HTMLTest.php index 125f012e50..374f74111f 100644 --- a/tests/src/Content/Text/HTMLTest.php +++ b/tests/src/Content/Text/HTMLTest.php @@ -10,11 +10,11 @@ namespace Friendica\Test\src\Content\Text; use Exception; use Friendica\Content\Text\HTML; use Friendica\Network\HTTPException\InternalServerErrorException; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use GuzzleHttp\Psr7\Uri; use Psr\Http\Message\UriInterface; -class HTMLTest extends FixtureTest +class HTMLTest extends FixtureTestCase { public function dataHTML() { diff --git a/tests/src/Content/Text/MarkdownTest.php b/tests/src/Content/Text/MarkdownTest.php index c6a774ba4f..6882bec7f1 100644 --- a/tests/src/Content/Text/MarkdownTest.php +++ b/tests/src/Content/Text/MarkdownTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Content\Text; use Exception; use Friendica\Content\Text\Markdown; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class MarkdownTest extends FixtureTest +class MarkdownTest extends FixtureTestCase { public function dataMarkdown() { diff --git a/tests/src/Content/Text/PlaintextTest.php b/tests/src/Content/Text/PlaintextTest.php index 5c5877ac75..814e842c72 100644 --- a/tests/src/Content/Text/PlaintextTest.php +++ b/tests/src/Content/Text/PlaintextTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\Plaintext; 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 { diff --git a/tests/src/Core/ACLTest.php b/tests/src/Core/ACLTest.php index 11e2c9df74..49d791ac77 100644 --- a/tests/src/Core/ACLTest.php +++ b/tests/src/Core/ACLTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Core; 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. diff --git a/tests/src/Core/Config/ConfigTransactionTest.php b/tests/src/Core/Config/ConfigTransactionTest.php index 46942393dd..65efe3e14e 100644 --- a/tests/src/Core/Config/ConfigTransactionTest.php +++ b/tests/src/Core/Config/ConfigTransactionTest.php @@ -15,13 +15,13 @@ use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Database\Database; use Friendica\Test\DatabaseTest; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\MockedTest; use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\VFSTrait; use Mockery\Exception\InvalidCountException; -class ConfigTransactionTest extends FixtureTest +class ConfigTransactionTest extends FixtureTestCase { /** @var ConfigFileManager */ protected $configFileManager; diff --git a/tests/src/Core/Worker/Repository/ProcessTest.php b/tests/src/Core/Worker/Repository/ProcessTest.php index 98659b3ce0..eb31556e74 100644 --- a/tests/src/Core/Worker/Repository/ProcessTest.php +++ b/tests/src/Core/Worker/Repository/ProcessTest.php @@ -10,10 +10,10 @@ namespace Friendica\Test\src\Core\Worker\Repository; use Friendica\Core\Worker\Factory; use Friendica\Core\Worker\Repository; use Friendica\DI; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Psr\Log\NullLogger; -class ProcessTest extends FixtureTest +class ProcessTest extends FixtureTestCase { public function testStandardProcess() { diff --git a/tests/src/Database/DatabaseTest.php b/tests/src/Database/DatabaseTest.php index ef83e46394..c889d6d7d1 100644 --- a/tests/src/Database/DatabaseTest.php +++ b/tests/src/Database/DatabaseTest.php @@ -9,10 +9,10 @@ namespace Friendica\Test\src\Database; use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\ValueObject\Cache; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\Util\CreateDatabaseTrait; -class DatabaseTest extends FixtureTest +class DatabaseTest extends FixtureTestCase { use CreateDatabaseTrait; diff --git a/tests/src/Factory/Api/Mastodon/EmojiTest.php b/tests/src/Factory/Api/Mastodon/EmojiTest.php index 0221ba9de1..24dba047e6 100644 --- a/tests/src/Factory/Api/Mastodon/EmojiTest.php +++ b/tests/src/Factory/Api/Mastodon/EmojiTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Factory\Api\Mastodon; use Friendica\Content\Smilies; use Friendica\DI; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class EmojiTest extends FixtureTest +class EmojiTest extends FixtureTestCase { protected function setUp(): void { diff --git a/tests/src/Factory/Api/Mastodon/StatusTest.php b/tests/src/Factory/Api/Mastodon/StatusTest.php index c793bef7d1..314195bb5a 100644 --- a/tests/src/Factory/Api/Mastodon/StatusTest.php +++ b/tests/src/Factory/Api/Mastodon/StatusTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Factory\Api\Mastodon; use Friendica\Core\Hook; use Friendica\DI; use Friendica\Model\Post; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class StatusTest extends FixtureTest +class StatusTest extends FixtureTestCase { protected $status; diff --git a/tests/src/Factory/Api/Twitter/ActivitiesTest.php b/tests/src/Factory/Api/Twitter/ActivitiesTest.php index 825afe840c..a00f1d7e94 100644 --- a/tests/src/Factory/Api/Twitter/ActivitiesTest.php +++ b/tests/src/Factory/Api/Twitter/ActivitiesTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Factory\Api\Twitter; use Friendica\DI; 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. diff --git a/tests/src/Factory/Api/Twitter/DirectMessageTest.php b/tests/src/Factory/Api/Twitter/DirectMessageTest.php index 9399bf6106..8cb54657f3 100644 --- a/tests/src/Factory/Api/Twitter/DirectMessageTest.php +++ b/tests/src/Factory/Api/Twitter/DirectMessageTest.php @@ -9,10 +9,10 @@ namespace Friendica\Test\src\Factory\Api\Twitter; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\src\Module\Api\ApiTest; -class DirectMessageTest extends FixtureTest +class DirectMessageTest extends FixtureTestCase { /** * Test the api_format_messages() function. diff --git a/tests/src/Factory/Api/Twitter/StatusTest.php b/tests/src/Factory/Api/Twitter/StatusTest.php index c92b08f243..847fbc2d22 100644 --- a/tests/src/Factory/Api/Twitter/StatusTest.php +++ b/tests/src/Factory/Api/Twitter/StatusTest.php @@ -16,10 +16,10 @@ use Friendica\Factory\Api\Twitter\Media; use Friendica\Factory\Api\Twitter\Mention; use Friendica\Factory\Api\Twitter\Status; use Friendica\Factory\Api\Twitter\Url; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\src\Module\Api\ApiTest; -class StatusTest extends FixtureTest +class StatusTest extends FixtureTestCase { protected $statusFactory; diff --git a/tests/src/Factory/Api/Twitter/UserTest.php b/tests/src/Factory/Api/Twitter/UserTest.php index 4203839834..a4532afc36 100644 --- a/tests/src/Factory/Api/Twitter/UserTest.php +++ b/tests/src/Factory/Api/Twitter/UserTest.php @@ -10,10 +10,10 @@ namespace Friendica\Test\src\Factory\Api\Twitter; use Friendica\DI; use Friendica\Factory\Api\Twitter\User; use Friendica\Network\HTTPException\NotFoundException; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\src\Module\Api\ApiTest; -class UserTest extends FixtureTest +class UserTest extends FixtureTestCase { /** * Assert that an user array contains expected keys. diff --git a/tests/src/Module/Api/ApiTest.php b/tests/src/Module/Api/ApiTest.php index 16763f1d52..dd73e983d1 100644 --- a/tests/src/Module/Api/ApiTest.php +++ b/tests/src/Module/Api/ApiTest.php @@ -17,14 +17,14 @@ use Friendica\DI; use Friendica\Module\Special\HTTPException; use Friendica\Security\Authentication; use Friendica\Security\BasicAuth; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthTestConfig; use Mockery\MockInterface; use Psr\Http\Message\ResponseInterface; -abstract class ApiTest extends FixtureTest +abstract class ApiTest extends FixtureTestCase { // User data that the test database is populated with const SELF_USER = [ diff --git a/tests/src/Module/Api/Twitter/ContactEndpointTest.php b/tests/src/Module/Api/Twitter/ContactEndpointTest.php index 3f4c463c5b..bdb5b96d3c 100644 --- a/tests/src/Module/Api/Twitter/ContactEndpointTest.php +++ b/tests/src/Module/Api/Twitter/ContactEndpointTest.php @@ -12,9 +12,9 @@ use Friendica\Module\Api\Twitter\ContactEndpoint; use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\NotFoundException; use Friendica\Object\Api\Twitter\User; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class ContactEndpointTest extends FixtureTest +class ContactEndpointTest extends FixtureTestCase { public function testIds() { diff --git a/tests/src/Module/NodeInfoTest.php b/tests/src/Module/NodeInfoTest.php index c0f23a6f15..21af637508 100644 --- a/tests/src/Module/NodeInfoTest.php +++ b/tests/src/Module/NodeInfoTest.php @@ -14,10 +14,10 @@ use Friendica\Module\NodeInfo110; use Friendica\Module\NodeInfo120; use Friendica\Module\NodeInfo210; use Friendica\Module\Special\HTTPException; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Mockery\MockInterface; -class NodeInfoTest extends FixtureTest +class NodeInfoTest extends FixtureTestCase { /** @var MockInterface|HTTPException */ protected $httpExceptionMock; diff --git a/tests/src/Module/Special/OptionsTest.php b/tests/src/Module/Special/OptionsTest.php index 4a8ced5458..eb6e40e08a 100644 --- a/tests/src/Module/Special/OptionsTest.php +++ b/tests/src/Module/Special/OptionsTest.php @@ -12,10 +12,10 @@ use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Special\HTTPException; use Friendica\Module\Special\Options; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Mockery\MockInterface; -class OptionsTest extends FixtureTest +class OptionsTest extends FixtureTestCase { /** @var MockInterface|HTTPException */ protected $httpExceptionMock; diff --git a/tests/src/Navigation/Notifications/Entity/NotifyTest.php b/tests/src/Navigation/Notifications/Entity/NotifyTest.php index a1017fd5ad..ff88e36b90 100644 --- a/tests/src/Navigation/Notifications/Entity/NotifyTest.php +++ b/tests/src/Navigation/Notifications/Entity/NotifyTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Navigation\Notifications\Entity; use Friendica\Navigation\Notifications\Entity\Notify; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class NotifyTest extends FixtureTest +class NotifyTest extends FixtureTestCase { public function dataFormatNotify(): array { diff --git a/tests/src/Profile/ProfileField/Repository/ProfileFieldTest.php b/tests/src/Profile/ProfileField/Repository/ProfileFieldTest.php index b9eb50063e..2f5ab7bce8 100644 --- a/tests/src/Profile/ProfileField/Repository/ProfileFieldTest.php +++ b/tests/src/Profile/ProfileField/Repository/ProfileFieldTest.php @@ -14,10 +14,10 @@ use Friendica\Profile\ProfileField\Factory\ProfileField as ProfileFieldFactory; use Friendica\Security\PermissionSet\Repository\PermissionSet; use Friendica\Security\PermissionSet\Factory\PermissionSet as PermissionSetFactory; use Friendica\Security\PermissionSet\Repository\PermissionSet as PermissionSetRepository; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\DI; -class ProfileFieldTest extends FixtureTest +class ProfileFieldTest extends FixtureTestCase { /** @var ProfileFieldRepository */ private $depository; diff --git a/tests/src/Protocol/ActivityPub/TransmitterTest.php b/tests/src/Protocol/ActivityPub/TransmitterTest.php index 40146fe926..8b71aa130b 100644 --- a/tests/src/Protocol/ActivityPub/TransmitterTest.php +++ b/tests/src/Protocol/ActivityPub/TransmitterTest.php @@ -11,9 +11,9 @@ use Friendica\Core\Hook; use Friendica\DI; use Friendica\Model\Post; use Friendica\Protocol\ActivityPub\Transmitter; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; -class TransmitterTest extends FixtureTest +class TransmitterTest extends FixtureTestCase { protected function setUp(): void { diff --git a/tests/src/Security/PermissionSet/Repository/PermissionSetTest.php b/tests/src/Security/PermissionSet/Repository/PermissionSetTest.php index 522f106a9f..d92789668d 100644 --- a/tests/src/Security/PermissionSet/Repository/PermissionSetTest.php +++ b/tests/src/Security/PermissionSet/Repository/PermissionSetTest.php @@ -13,10 +13,10 @@ use Friendica\Security\PermissionSet\Exception\PermissionSetNotFoundException; use Friendica\Security\PermissionSet\Repository\PermissionSet as PermissionSetRepository; use Friendica\Security\PermissionSet\Entity\PermissionSet; use Friendica\Security\PermissionSet\Factory\PermissionSet as PermissionSetFactory; -use Friendica\Test\FixtureTest; +use Friendica\Test\FixtureTestCase; use Friendica\DI; -class PermissionSetTest extends FixtureTest +class PermissionSetTest extends FixtureTestCase { /** @var PermissionSetRepository */ private $repository; From 4f02c9ca88d73610513989f13bb0c764abd76f32 Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 13 Dec 2024 22:10:30 +0000 Subject: [PATCH 04/12] rename DatabaseTest to DatabaseTestCase --- tests/{DatabaseTest.php => DatabaseTestCase.php} | 2 +- tests/Util/CreateDatabaseTrait.php | 2 +- tests/src/Content/PageInfoTest.php | 4 ++-- tests/src/Core/Cache/DatabaseCacheTest.php | 2 +- tests/src/Core/Config/ConfigTest.php | 4 ++-- tests/src/Core/Config/ConfigTransactionTest.php | 2 +- tests/src/Core/Storage/Repository/StorageManagerTest.php | 4 ++-- tests/src/Database/DBATest.php | 4 ++-- tests/src/Database/DBStructureTest.php | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) rename tests/{DatabaseTest.php => DatabaseTestCase.php} (89%) diff --git a/tests/DatabaseTest.php b/tests/DatabaseTestCase.php similarity index 89% rename from tests/DatabaseTest.php rename to tests/DatabaseTestCase.php index af6e45226a..b061a7f21a 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTestCase.php @@ -10,7 +10,7 @@ namespace Friendica\Test; /** * Abstract class used by tests that need a database. */ -abstract class DatabaseTest extends MockedTestCase +abstract class DatabaseTestCase extends MockedTestCase { use DatabaseTestTrait; diff --git a/tests/Util/CreateDatabaseTrait.php b/tests/Util/CreateDatabaseTrait.php index c188ee8f94..52a7625734 100644 --- a/tests/Util/CreateDatabaseTrait.php +++ b/tests/Util/CreateDatabaseTrait.php @@ -13,7 +13,7 @@ use Friendica\Core\Config\ValueObject\Cache; use Friendica\Database\Database; use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\ViewDefinition; -use Friendica\Test\DatabaseTestTrait; +use Friendica\Test\DatabaseTestCaseTrait; use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Util\Profiler; use Psr\Log\NullLogger; diff --git a/tests/src/Content/PageInfoTest.php b/tests/src/Content/PageInfoTest.php index a88c1fe4a6..324381a4dd 100644 --- a/tests/src/Content/PageInfoTest.php +++ b/tests/src/Content/PageInfoTest.php @@ -7,9 +7,9 @@ namespace Friendica\Test\src\Content; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; -class PageInfoTest extends DatabaseTest +class PageInfoTest extends DatabaseTestCase { public function dataGetRelevantUrlFromBody() { diff --git a/tests/src/Core/Cache/DatabaseCacheTest.php b/tests/src/Core/Cache/DatabaseCacheTest.php index 5b4c61bc88..66e44d4754 100644 --- a/tests/src/Core/Cache/DatabaseCacheTest.php +++ b/tests/src/Core/Cache/DatabaseCacheTest.php @@ -9,7 +9,7 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\App\BaseURL; use Friendica\Core\Cache; -use Friendica\Test\DatabaseTestTrait; +use Friendica\Test\DatabaseTestCaseTrait; use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\VFSTrait; diff --git a/tests/src/Core/Config/ConfigTest.php b/tests/src/Core/Config/ConfigTest.php index ed5e329aea..83dbaa0af0 100644 --- a/tests/src/Core/Config/ConfigTest.php +++ b/tests/src/Core/Config/ConfigTest.php @@ -13,12 +13,12 @@ use Friendica\Core\Config\Model\DatabaseConfig; use Friendica\Core\Config\Model\ReadOnlyFileConfig; use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\ValueObject\Cache; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\VFSTrait; use org\bovigo\vfs\vfsStream; -class ConfigTest extends DatabaseTest +class ConfigTest extends DatabaseTestCase { use ArraySubsetAsserts; use VFSTrait; diff --git a/tests/src/Core/Config/ConfigTransactionTest.php b/tests/src/Core/Config/ConfigTransactionTest.php index 65efe3e14e..5c704b7600 100644 --- a/tests/src/Core/Config/ConfigTransactionTest.php +++ b/tests/src/Core/Config/ConfigTransactionTest.php @@ -14,7 +14,7 @@ use Friendica\Core\Config\Model\ConfigTransaction; use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Database\Database; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; use Friendica\Test\FixtureTestCase; use Friendica\Test\MockedTest; use Friendica\Test\Util\Database\StaticDatabase; diff --git a/tests/src/Core/Storage/Repository/StorageManagerTest.php b/tests/src/Core/Storage/Repository/StorageManagerTest.php index 0123f512c7..ac74274c03 100644 --- a/tests/src/Core/Storage/Repository/StorageManagerTest.php +++ b/tests/src/Core/Storage/Repository/StorageManagerTest.php @@ -26,7 +26,7 @@ use Friendica\Database\Definition\ViewDefinition; use Friendica\DI; use Friendica\Core\Config\Factory\Config; use Friendica\Core\Storage\Type; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Test\Util\VFSTrait; @@ -36,7 +36,7 @@ use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use Friendica\Test\Util\SampleStorageBackend; -class StorageManagerTest extends DatabaseTest +class StorageManagerTest extends DatabaseTestCase { use CreateDatabaseTrait; diff --git a/tests/src/Database/DBATest.php b/tests/src/Database/DBATest.php index 242af45470..49d3a6a5e6 100644 --- a/tests/src/Database/DBATest.php +++ b/tests/src/Database/DBATest.php @@ -11,10 +11,10 @@ use Dice\Dice; use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; use Friendica\Test\Util\Database\StaticDatabase; -class DBATest extends DatabaseTest +class DBATest extends DatabaseTestCase { protected function setUp(): void { diff --git a/tests/src/Database/DBStructureTest.php b/tests/src/Database/DBStructureTest.php index 377c753a47..9ce3475ee7 100644 --- a/tests/src/Database/DBStructureTest.php +++ b/tests/src/Database/DBStructureTest.php @@ -11,10 +11,10 @@ use Dice\Dice; use Friendica\Database\Database; use Friendica\Database\DBStructure; use Friendica\DI; -use Friendica\Test\DatabaseTest; +use Friendica\Test\DatabaseTestCase; use Friendica\Test\Util\Database\StaticDatabase; -class DBStructureTest extends DatabaseTest +class DBStructureTest extends DatabaseTestCase { protected function setUp(): void { From 06667fc37c05feeb80404190e35a2ade3c2274aa Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 13 Dec 2024 22:22:50 +0000 Subject: [PATCH 05/12] Fix use statements --- tests/Util/CreateDatabaseTrait.php | 2 +- tests/src/Core/Cache/DatabaseCacheTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Util/CreateDatabaseTrait.php b/tests/Util/CreateDatabaseTrait.php index 52a7625734..c188ee8f94 100644 --- a/tests/Util/CreateDatabaseTrait.php +++ b/tests/Util/CreateDatabaseTrait.php @@ -13,7 +13,7 @@ use Friendica\Core\Config\ValueObject\Cache; use Friendica\Database\Database; use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\ViewDefinition; -use Friendica\Test\DatabaseTestCaseTrait; +use Friendica\Test\DatabaseTestTrait; use Friendica\Test\Util\Database\StaticDatabase; use Friendica\Util\Profiler; use Psr\Log\NullLogger; diff --git a/tests/src/Core/Cache/DatabaseCacheTest.php b/tests/src/Core/Cache/DatabaseCacheTest.php index 66e44d4754..5b4c61bc88 100644 --- a/tests/src/Core/Cache/DatabaseCacheTest.php +++ b/tests/src/Core/Cache/DatabaseCacheTest.php @@ -9,7 +9,7 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\App\BaseURL; use Friendica\Core\Cache; -use Friendica\Test\DatabaseTestCaseTrait; +use Friendica\Test\DatabaseTestTrait; use Friendica\Test\Util\CreateDatabaseTrait; use Friendica\Test\Util\VFSTrait; From b3cf518628aba830e0918075ac61cb320b2620bd Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 13 Dec 2024 22:42:27 +0000 Subject: [PATCH 06/12] rename and move ApiTest to ApiTestCase --- .../Api/ApiTest.php => ApiTestCase.php} | 7 ++---- .../Factory/Api/Twitter/DirectMessageTest.php | 10 ++++---- tests/src/Factory/Api/Twitter/StatusTest.php | 8 +++---- tests/src/Factory/Api/Twitter/UserTest.php | 24 +++++++++---------- .../Friendica/DirectMessages/SearchTest.php | 4 ++-- .../Module/Api/Friendica/NotificationTest.php | 4 ++-- .../Module/Api/Friendica/Photo/DeleteTest.php | 4 ++-- .../Api/Friendica/Photoalbum/DeleteTest.php | 4 ++-- .../Api/Friendica/Photoalbum/UpdateTest.php | 4 ++-- .../Api/GnuSocial/GnuSocial/ConfigTest.php | 4 ++-- .../Api/GnuSocial/GnuSocial/VersionTest.php | 4 ++-- .../Module/Api/GnuSocial/Help/TestTest.php | 4 ++-- .../Api/Mastodon/Accounts/StatusesTest.php | 4 ++-- .../Accounts/VerifyCredentialsTest.php | 4 ++-- .../Module/Api/Mastodon/ConversationsTest.php | 4 ++-- .../Api/Mastodon/PushSubscriptionTest.php | 4 ++-- tests/src/Module/Api/Mastodon/SearchTest.php | 4 ++-- .../Api/Mastodon/Timelines/HomeTest.php | 4 ++-- .../Mastodon/Timelines/PublicTimelineTest.php | 4 ++-- .../Twitter/Account/RateLimitStatusTest.php | 4 ++-- .../Api/Twitter/Account/UpdateProfileTest.php | 4 ++-- .../Module/Api/Twitter/Blocks/ListsTest.php | 4 ++-- .../Api/Twitter/DirectMessages/AllTest.php | 4 ++-- .../DirectMessages/ConversationTest.php | 4 ++-- .../Twitter/DirectMessages/DestroyTest.php | 4 ++-- .../Api/Twitter/DirectMessages/InboxTest.php | 4 ++-- .../Api/Twitter/DirectMessages/NewDMTest.php | 4 ++-- .../Api/Twitter/DirectMessages/SentTest.php | 4 ++-- .../Api/Twitter/Favorites/CreateTest.php | 4 ++-- .../Api/Twitter/Favorites/DestroyTest.php | 4 ++-- .../src/Module/Api/Twitter/FavoritesTest.php | 4 ++-- .../Api/Twitter/Followers/ListsTest.php | 4 ++-- .../Module/Api/Twitter/Friends/ListsTest.php | 4 ++-- .../Api/Twitter/Friendships/IncomingTest.php | 4 ++-- .../Module/Api/Twitter/Lists/StatusesTest.php | 4 ++-- .../Module/Api/Twitter/Media/UploadTest.php | 4 ++-- .../Module/Api/Twitter/SavedSearchesTest.php | 4 ++-- .../Api/Twitter/Statuses/DestroyTest.php | 4 ++-- .../Api/Twitter/Statuses/MentionsTest.php | 4 ++-- .../Statuses/NetworkPublicTimelineTest.php | 4 ++-- .../Api/Twitter/Statuses/RetweetTest.php | 4 ++-- .../Module/Api/Twitter/Statuses/ShowTest.php | 4 ++-- .../Api/Twitter/Statuses/UpdateTest.php | 4 ++-- .../Api/Twitter/Statuses/UserTimelineTest.php | 4 ++-- .../Module/Api/Twitter/Users/LookupTest.php | 4 ++-- .../Module/Api/Twitter/Users/SearchTest.php | 4 ++-- .../src/Module/Api/Twitter/Users/ShowTest.php | 4 ++-- tests/src/Module/BaseApiTest.php | 4 ++-- tests/src/Security/BasicAuthTest.php | 4 ++-- 49 files changed, 113 insertions(+), 116 deletions(-) rename tests/{src/Module/Api/ApiTest.php => ApiTestCase.php} (96%) diff --git a/tests/src/Module/Api/ApiTest.php b/tests/ApiTestCase.php similarity index 96% rename from tests/src/Module/Api/ApiTest.php rename to tests/ApiTestCase.php index dd73e983d1..636550a894 100644 --- a/tests/src/Module/Api/ApiTest.php +++ b/tests/ApiTestCase.php @@ -5,26 +5,23 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -namespace Friendica\Test\src\Module\Api; +namespace Friendica\Test; use Friendica\App; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; -use Friendica\Database\Database; use Friendica\DI; use Friendica\Module\Special\HTTPException; use Friendica\Security\Authentication; use Friendica\Security\BasicAuth; -use Friendica\Test\FixtureTestCase; use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthTestConfig; -use Mockery\MockInterface; use Psr\Http\Message\ResponseInterface; -abstract class ApiTest extends FixtureTestCase +abstract class ApiTestCase extends FixtureTestCase { // User data that the test database is populated with const SELF_USER = [ diff --git a/tests/src/Factory/Api/Twitter/DirectMessageTest.php b/tests/src/Factory/Api/Twitter/DirectMessageTest.php index 8cb54657f3..1c8b12fa7e 100644 --- a/tests/src/Factory/Api/Twitter/DirectMessageTest.php +++ b/tests/src/Factory/Api/Twitter/DirectMessageTest.php @@ -10,7 +10,7 @@ namespace Friendica\Test\src\Factory\Api\Twitter; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Test\FixtureTestCase; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; class DirectMessageTest extends FixtureTestCase { @@ -26,7 +26,7 @@ class DirectMessageTest extends FixtureTestCase $id = $ids[0]['id']; $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) - ->createFromMailId($id, ApiTest::SELF_USER['id']) + ->createFromMailId($id, ApiTestCase::SELF_USER['id']) ->toArray(); self::assertEquals('item_title' . "\n" . 'item_body', $directMessage['text']); @@ -49,7 +49,7 @@ class DirectMessageTest extends FixtureTestCase $id = $ids[0]['id']; $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) - ->createFromMailId($id, ApiTest::SELF_USER['id'], 'html') + ->createFromMailId($id, ApiTestCase::SELF_USER['id'], 'html') ->toArray(); self::assertEquals('item_title', $directMessage['title']); @@ -68,7 +68,7 @@ class DirectMessageTest extends FixtureTestCase $id = $ids[0]['id']; $directMessage = (new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser())) - ->createFromMailId($id, ApiTest::SELF_USER['id'], 'plain') + ->createFromMailId($id, ApiTestCase::SELF_USER['id'], 'plain') ->toArray(); self::assertEquals('item_title', $directMessage['title']); @@ -90,7 +90,7 @@ class DirectMessageTest extends FixtureTestCase $id = $ids[0]['id']; $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(); self::assertTrue(!isset($directMessage['sender'])); diff --git a/tests/src/Factory/Api/Twitter/StatusTest.php b/tests/src/Factory/Api/Twitter/StatusTest.php index 847fbc2d22..0fc36e9995 100644 --- a/tests/src/Factory/Api/Twitter/StatusTest.php +++ b/tests/src/Factory/Api/Twitter/StatusTest.php @@ -17,7 +17,7 @@ use Friendica\Factory\Api\Twitter\Mention; use Friendica\Factory\Api\Twitter\Status; use Friendica\Factory\Api\Twitter\Url; use Friendica\Test\FixtureTestCase; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; class StatusTest extends FixtureTestCase { @@ -47,7 +47,7 @@ class StatusTest extends FixtureTestCase public function testApiConvertItem() { $status = $this->statusFactory - ->createFromItemId(13, ApiTest::SELF_USER['id']) + ->createFromItemId(13, ApiTestCase::SELF_USER['id']) ->toArray(); self::assertStringStartsWith('item_title', $status['text']); @@ -108,7 +108,7 @@ class StatusTest extends FixtureTestCase public function testApiGetEntitiesWithIncludeEntities() { $status = $this->statusFactory - ->createFromItemId(13, ApiTest::SELF_USER['id'], true) + ->createFromItemId(13, ApiTestCase::SELF_USER['id'], true) ->toArray(); self::assertIsArray($status['entities']); @@ -130,7 +130,7 @@ class StatusTest extends FixtureTestCase $posts = DI::dba()->selectToArray('post-view', ['uri-id']); foreach ($posts as $item) { $status = $this->statusFactory - ->createFromUriId($item['uri-id'], ApiTest::SELF_USER['id']) + ->createFromUriId($item['uri-id'], ApiTestCase::SELF_USER['id']) ->toArray(); self::assertIsInt($status['id']); diff --git a/tests/src/Factory/Api/Twitter/UserTest.php b/tests/src/Factory/Api/Twitter/UserTest.php index a4532afc36..e671c44111 100644 --- a/tests/src/Factory/Api/Twitter/UserTest.php +++ b/tests/src/Factory/Api/Twitter/UserTest.php @@ -11,7 +11,7 @@ use Friendica\DI; use Friendica\Factory\Api\Twitter\User; use Friendica\Network\HTTPException\NotFoundException; use Friendica\Test\FixtureTestCase; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; class UserTest extends FixtureTestCase { @@ -22,11 +22,11 @@ class UserTest extends FixtureTestCase */ protected function assertSelfUser(array $user) { - self::assertEquals(ApiTest::SELF_USER['id'], $user['uid']); - self::assertEquals(ApiTest::SELF_USER['id'], $user['cid']); + self::assertEquals(ApiTestCase::SELF_USER['id'], $user['uid']); + self::assertEquals(ApiTestCase::SELF_USER['id'], $user['cid']); self::assertEquals('DFRN', $user['location']); - self::assertEquals(ApiTest::SELF_USER['name'], $user['name']); - self::assertEquals(ApiTest::SELF_USER['nick'], $user['screen_name']); + self::assertEquals(ApiTestCase::SELF_USER['name'], $user['name']); + self::assertEquals(ApiTestCase::SELF_USER['nick'], $user['screen_name']); self::assertTrue($user['verified']); } @@ -38,7 +38,7 @@ class UserTest extends FixtureTestCase public function testApiGetUser() { $user = (new User(DI::logger(), DI::twitterStatus())) - ->createFromUserId(ApiTest::SELF_USER['id']) + ->createFromUserId(ApiTestCase::SELF_USER['id']) ->toArray(); $this->assertSelfUser($user); @@ -54,7 +54,7 @@ class UserTest extends FixtureTestCase $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()); $user = $userFactory->createFromUserId(42); @@ -76,7 +76,7 @@ class UserTest extends FixtureTestCase $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()); $user = $userFactory->createFromUserId(42); @@ -98,10 +98,10 @@ class UserTest extends FixtureTestCase $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(ApiTest::SELF_USER['id'], 'frio', 'nav_bg', '#123456'); - DI::pConfig()->set(ApiTest::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', 'schema', '---'); + DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'nav_bg', '#123456'); + DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'link_color', '#123456'); + DI::pConfig()->set(ApiTestCase::SELF_USER['id'], 'frio', 'background_color', '#123456'); $userFactory = new User(DI::logger(), DI::twitterStatus()); $user = $userFactory->createFromUserId(42); diff --git a/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php b/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php index c312eccd7d..998bad5264 100644 --- a/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php +++ b/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php @@ -11,10 +11,10 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Module\Api\Friendica\DirectMessages\Search; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; use Psr\Log\NullLogger; -class SearchTest extends ApiTest +class SearchTest extends ApiTestCase { public function testEmpty() { diff --git a/tests/src/Module/Api/Friendica/NotificationTest.php b/tests/src/Module/Api/Friendica/NotificationTest.php index c7db6798e3..e05041acb6 100644 --- a/tests/src/Module/Api/Friendica/NotificationTest.php +++ b/tests/src/Module/Api/Friendica/NotificationTest.php @@ -10,11 +10,11 @@ namespace Friendica\Test\src\Module\Api\Friendica; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Friendica\Notification; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; -class NotificationTest extends ApiTest +class NotificationTest extends ApiTestCase { public function testEmpty() { diff --git a/tests/src/Module/Api/Friendica/Photo/DeleteTest.php b/tests/src/Module/Api/Friendica/Photo/DeleteTest.php index a355f13fe0..1ba144011c 100644 --- a/tests/src/Module/Api/Friendica/Photo/DeleteTest.php +++ b/tests/src/Module/Api/Friendica/Photo/DeleteTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Friendica\Photo\Delete; 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 { diff --git a/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php b/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php index 4e4939ee5b..fae9c2cf4d 100644 --- a/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php +++ b/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Friendica\Photoalbum\Delete; 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 { diff --git a/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php b/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php index c785ffe761..0b5f71f2b1 100644 --- a/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php +++ b/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Friendica\Photoalbum\Update; 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 { diff --git a/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php b/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php index 4bdd4fb461..6c51c4d1e6 100644 --- a/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php +++ b/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php @@ -9,9 +9,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial; use Friendica\DI; 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. diff --git a/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php b/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php index 5177a1e08b..099e052813 100644 --- a/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php +++ b/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; 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() { diff --git a/tests/src/Module/Api/GnuSocial/Help/TestTest.php b/tests/src/Module/Api/GnuSocial/Help/TestTest.php index c46c6a8357..6ca274765c 100644 --- a/tests/src/Module/Api/GnuSocial/Help/TestTest.php +++ b/tests/src/Module/Api/GnuSocial/Help/TestTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\Help; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; 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() { diff --git a/tests/src/Module/Api/Mastodon/Accounts/StatusesTest.php b/tests/src/Module/Api/Mastodon/Accounts/StatusesTest.php index 4f0d610d22..401c1a4b8f 100644 --- a/tests/src/Module/Api/Mastodon/Accounts/StatusesTest.php +++ b/tests/src/Module/Api/Mastodon/Accounts/StatusesTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php b/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php index c478e206be..e0fb146aaa 100644 --- a/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php +++ b/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Mastodon\Accounts; use Friendica\App\Router; use Friendica\DI; 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. diff --git a/tests/src/Module/Api/Mastodon/ConversationsTest.php b/tests/src/Module/Api/Mastodon/ConversationsTest.php index c9859e44ed..38736b64f8 100644 --- a/tests/src/Module/Api/Mastodon/ConversationsTest.php +++ b/tests/src/Module/Api/Mastodon/ConversationsTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php b/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php index bfc11bd81c..33e352d924 100644 --- a/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php +++ b/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Mastodon/SearchTest.php b/tests/src/Module/Api/Mastodon/SearchTest.php index 3f89fd13f3..5b04cf01af 100644 --- a/tests/src/Module/Api/Mastodon/SearchTest.php +++ b/tests/src/Module/Api/Mastodon/SearchTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Mastodon/Timelines/HomeTest.php b/tests/src/Module/Api/Mastodon/Timelines/HomeTest.php index 1dfbe24b1f..b5bbd7bccc 100644 --- a/tests/src/Module/Api/Mastodon/Timelines/HomeTest.php +++ b/tests/src/Module/Api/Mastodon/Timelines/HomeTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Mastodon/Timelines/PublicTimelineTest.php b/tests/src/Module/Api/Mastodon/Timelines/PublicTimelineTest.php index f1cb965df3..017d1fb62a 100644 --- a/tests/src/Module/Api/Mastodon/Timelines/PublicTimelineTest.php +++ b/tests/src/Module/Api/Mastodon/Timelines/PublicTimelineTest.php @@ -7,9 +7,9 @@ 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. diff --git a/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php b/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php index f01c040d36..c0d1e89028 100644 --- a/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php +++ b/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Account\RateLimitStatus; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class RateLimitStatusTest extends ApiTest +class RateLimitStatusTest extends ApiTestCase { public function testWithJson() { diff --git a/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php b/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php index 3893a1b35d..3ba7a3d996 100644 --- a/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php +++ b/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Account; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Account\UpdateProfile; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class UpdateProfileTest extends ApiTest +class UpdateProfileTest extends ApiTestCase { /** * Test the api_account_update_profile() function. diff --git a/tests/src/Module/Api/Twitter/Blocks/ListsTest.php b/tests/src/Module/Api/Twitter/Blocks/ListsTest.php index 1b55750845..d41446bf2e 100644 --- a/tests/src/Module/Api/Twitter/Blocks/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Blocks/ListsTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Blocks; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Blocks\Lists; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ListsTest extends ApiTest +class ListsTest extends ApiTestCase { /** * Test the api_statuses_f() function. diff --git a/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php b/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php index 67c2606cd3..c4c1b7d7b9 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\DirectMessages; use Friendica\DI; use Friendica\Module\Api\Twitter\DirectMessages\All; use Friendica\Factory\Api\Twitter\DirectMessage; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class AllTest extends ApiTest +class AllTest extends ApiTestCase { /** * Test the api_direct_messages_box() function. diff --git a/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php index 5899ada8ad..f1a4aed615 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Module\Api\Twitter\DirectMessages\Conversation; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ConversationTest extends ApiTest +class ConversationTest extends ApiTestCase { /** * Test the api_direct_messages_box() function. diff --git a/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php b/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php index c81b18e83c..198eade10d 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Module\Api\Twitter\DirectMessages\Destroy; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class DestroyTest extends ApiTest +class DestroyTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php index 4b86e057b9..7f2ce706b2 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Module\Api\Twitter\DirectMessages\Inbox; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class InboxTest extends ApiTest +class InboxTest extends ApiTestCase { /** * Test the api_direct_messages_box() function. diff --git a/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php b/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php index 7bdaafaeff..33bf885751 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Module\Api\Twitter\DirectMessages\NewDM; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class NewDMTest extends ApiTest +class NewDMTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php b/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php index 2190022f8f..07d074fbb1 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Module\Api\Twitter\DirectMessages\Sent; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class SentTest extends ApiTest +class SentTest extends ApiTestCase { /** * Test the api_direct_messages_box() function. diff --git a/tests/src/Module/Api/Twitter/Favorites/CreateTest.php b/tests/src/Module/Api/Twitter/Favorites/CreateTest.php index d5d4f1c6a1..3e2a4e34c3 100644 --- a/tests/src/Module/Api/Twitter/Favorites/CreateTest.php +++ b/tests/src/Module/Api/Twitter/Favorites/CreateTest.php @@ -12,9 +12,9 @@ use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Favorites\Create; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class CreateTest extends ApiTest +class CreateTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php b/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php index 1909ff9c0b..24567a6056 100644 --- a/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Favorites\Destroy; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class DestroyTest extends ApiTest +class DestroyTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/FavoritesTest.php b/tests/src/Module/Api/Twitter/FavoritesTest.php index bc75fcf979..506258dc32 100644 --- a/tests/src/Module/Api/Twitter/FavoritesTest.php +++ b/tests/src/Module/Api/Twitter/FavoritesTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Favorites; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class FavoritesTest extends ApiTest +class FavoritesTest extends ApiTestCase { /** * Test the api_favorites() function. diff --git a/tests/src/Module/Api/Twitter/Followers/ListsTest.php b/tests/src/Module/Api/Twitter/Followers/ListsTest.php index 249d744371..5a4f66fd45 100644 --- a/tests/src/Module/Api/Twitter/Followers/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Followers/ListsTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Followers; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Followers\Lists; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ListsTest extends ApiTest +class ListsTest extends ApiTestCase { /** * Test the api_statuses_f() function. diff --git a/tests/src/Module/Api/Twitter/Friends/ListsTest.php b/tests/src/Module/Api/Twitter/Friends/ListsTest.php index 79ac2f147e..9665dceb0e 100644 --- a/tests/src/Module/Api/Twitter/Friends/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Friends/ListsTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Friends; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Friends\Lists; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ListsTest extends ApiTest +class ListsTest extends ApiTestCase { /** * Test the api_statuses_f() function. diff --git a/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php b/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php index ccb49b6163..a808e00b68 100644 --- a/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php +++ b/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Friendships; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Friendships\Incoming; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class IncomingTest extends ApiTest +class IncomingTest extends ApiTestCase { /** * Test the api_friendships_incoming() function. diff --git a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php index 658d6f776f..336233e057 100644 --- a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php +++ b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Lists\Statuses; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class StatusesTest extends ApiTest +class StatusesTest extends ApiTestCase { /** * Test the api_lists_statuses() function. diff --git a/tests/src/Module/Api/Twitter/Media/UploadTest.php b/tests/src/Module/Api/Twitter/Media/UploadTest.php index c1ed91a670..ae64eab9ed 100644 --- a/tests/src/Module/Api/Twitter/Media/UploadTest.php +++ b/tests/src/Module/Api/Twitter/Media/UploadTest.php @@ -13,10 +13,10 @@ use Friendica\Module\Api\Twitter\Media\Upload; use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\UnauthorizedException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; use Friendica\Test\Util\AuthTestConfig; -class UploadTest extends ApiTest +class UploadTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/SavedSearchesTest.php b/tests/src/Module/Api/Twitter/SavedSearchesTest.php index 80342a823c..44ed89cd9a 100644 --- a/tests/src/Module/Api/Twitter/SavedSearchesTest.php +++ b/tests/src/Module/Api/Twitter/SavedSearchesTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\SavedSearches; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class SavedSearchesTest extends ApiTest +class SavedSearchesTest extends ApiTestCase { public function test() { diff --git a/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php b/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php index 6f837199c1..ef3580df6e 100644 --- a/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Destroy; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class DestroyTest extends ApiTest +class DestroyTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php b/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php index 5459ea9b57..512505227c 100644 --- a/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Mentions; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class MentionsTest extends ApiTest +class MentionsTest extends ApiTestCase { /** * Test the api_statuses_mentions() function. diff --git a/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php b/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php index 41c0fc2388..9a68304b21 100644 --- a/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\NetworkPublicTimeline; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class NetworkPublicTimelineTest extends ApiTest +class NetworkPublicTimelineTest extends ApiTestCase { /** * Test the api_statuses_networkpublic_timeline() function. diff --git a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php index aaf549fd62..7c5a8f7ad1 100644 --- a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Retweet; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class RetweetTest extends ApiTest +class RetweetTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php index bbce067e9c..37844ac37a 100644 --- a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Show; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ShowTest extends ApiTest +class ShowTest extends ApiTestCase { /** * Test the api_statuses_show() function. diff --git a/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php b/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php index c7052bf63c..74663091ee 100644 --- a/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php @@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses; use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Update; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class UpdateTest extends ApiTest +class UpdateTest extends ApiTestCase { protected function setUp(): void { diff --git a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php index b39e9794bb..2e8e2f11c6 100644 --- a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\UserTimeline; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class UserTimelineTest extends ApiTest +class UserTimelineTest extends ApiTestCase { /** * Test the api_statuses_user_timeline() function. diff --git a/tests/src/Module/Api/Twitter/Users/LookupTest.php b/tests/src/Module/Api/Twitter/Users/LookupTest.php index 2bc701c018..fd8e077dca 100644 --- a/tests/src/Module/Api/Twitter/Users/LookupTest.php +++ b/tests/src/Module/Api/Twitter/Users/LookupTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\DI; use Friendica\Module\Api\Twitter\Users\Lookup; use Friendica\Network\HTTPException\NotFoundException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class LookupTest extends ApiTest +class LookupTest extends ApiTestCase { /** * Test the api_users_lookup() function. diff --git a/tests/src/Module/Api/Twitter/Users/SearchTest.php b/tests/src/Module/Api/Twitter/Users/SearchTest.php index 426e30eb0a..9a0b75be3c 100644 --- a/tests/src/Module/Api/Twitter/Users/SearchTest.php +++ b/tests/src/Module/Api/Twitter/Users/SearchTest.php @@ -12,9 +12,9 @@ use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Users\Search; use Friendica\Network\HTTPException\BadRequestException; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class SearchTest extends ApiTest +class SearchTest extends ApiTestCase { /** * Test the api_users_search() function. diff --git a/tests/src/Module/Api/Twitter/Users/ShowTest.php b/tests/src/Module/Api/Twitter/Users/ShowTest.php index 65c02fd780..80ebb59281 100644 --- a/tests/src/Module/Api/Twitter/Users/ShowTest.php +++ b/tests/src/Module/Api/Twitter/Users/ShowTest.php @@ -11,9 +11,9 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\Api\Twitter\Users\Show; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class ShowTest extends ApiTest +class ShowTest extends ApiTestCase { /** * Test the api_users_show() function. diff --git a/tests/src/Module/BaseApiTest.php b/tests/src/Module/BaseApiTest.php index 0a3d3f5cbb..4397913780 100644 --- a/tests/src/Module/BaseApiTest.php +++ b/tests/src/Module/BaseApiTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Module; use Friendica\Module\BaseApi; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class BaseApiTest extends ApiTest +class BaseApiTest extends ApiTestCase { public function testWithWrongAuth() { diff --git a/tests/src/Security/BasicAuthTest.php b/tests/src/Security/BasicAuthTest.php index 4636bb9ed9..72cf9df59e 100644 --- a/tests/src/Security/BasicAuthTest.php +++ b/tests/src/Security/BasicAuthTest.php @@ -8,9 +8,9 @@ namespace Friendica\Test\src\Security; use Friendica\Security\BasicAuth; -use Friendica\Test\src\Module\Api\ApiTest; +use Friendica\Test\ApiTestCase; -class BasicAuthTest extends ApiTest +class BasicAuthTest extends ApiTestCase { /** * Test the api_source() function. From e8c1f4ec2b4635c29f3cdafdab51477a14e1a040 Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 13 Dec 2024 22:47:32 +0000 Subject: [PATCH 07/12] Fix path to tests --- tests/ApiTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApiTestCase.php b/tests/ApiTestCase.php index 636550a894..26a6bb08ca 100644 --- a/tests/ApiTestCase.php +++ b/tests/ApiTestCase.php @@ -187,7 +187,7 @@ abstract class ApiTestCase extends FixtureTestCase public function installAuthTest() { $addon = 'authtest'; - $addon_file_path = __DIR__ . '/../../../Util/authtest/authtest.php'; + $addon_file_path = __DIR__ . '/Util/authtest/authtest.php'; $t = @filemtime($addon_file_path); @include_once($addon_file_path); From 4f1b917e42316f8d543e44135887e305594d940a Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 15 Dec 2024 22:15:46 +0000 Subject: [PATCH 08/12] Remove unused AppDouble class --- tests/ApiTestCase.php | 7 +------ tests/Util/AppDouble.php | 36 ------------------------------------ 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 tests/Util/AppDouble.php diff --git a/tests/ApiTestCase.php b/tests/ApiTestCase.php index 26a6bb08ca..a9c04249c2 100644 --- a/tests/ApiTestCase.php +++ b/tests/ApiTestCase.php @@ -7,7 +7,6 @@ namespace Friendica\Test; -use Friendica\App; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -16,7 +15,6 @@ use Friendica\DI; use Friendica\Module\Special\HTTPException; use Friendica\Security\Authentication; use Friendica\Security\BasicAuth; -use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthTestConfig; use Psr\Http\Message\ResponseInterface; @@ -158,12 +156,9 @@ abstract class ApiTestCase extends FixtureTestCase $this->dice = $this->dice ->addRule(Authentication::class, ['instanceOf' => AuthenticationDouble::class, 'shared' => true]) - ->addRule(App::class, ['instanceOf' => AppDouble::class, 'shared' => true]); + ; DI::init($this->dice); - // Manual override to bypass API authentication - DI::app()->setIsLoggedIn(true); - $this->httpExceptionMock = $this->dice->create(HTTPException::class); AuthTestConfig::$authenticated = true; diff --git a/tests/Util/AppDouble.php b/tests/Util/AppDouble.php deleted file mode 100644 index 305b7ccf7c..0000000000 --- a/tests/Util/AppDouble.php +++ /dev/null @@ -1,36 +0,0 @@ -isLoggedIn = $isLoggedIn; - } - - public function isLoggedIn(): bool - { - return $this->isLoggedIn; - } -} From 1d441ab657c42c3ef5b0c882daef9dc4d3018837 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 18 Dec 2024 19:57:00 +0000 Subject: [PATCH 09/12] remove unnecessary Di::app() all --- tests/ApiTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApiTestCase.php b/tests/ApiTestCase.php index a9c04249c2..bcf916abed 100644 --- a/tests/ApiTestCase.php +++ b/tests/ApiTestCase.php @@ -188,7 +188,7 @@ abstract class ApiTestCase extends FixtureTestCase @include_once($addon_file_path); if (function_exists($addon . '_install')) { $func = $addon . '_install'; - $func(DI::app()); + $func(); } /** @var $config IManageConfigValues */ From b2a383a9cbb7f374ef46c2eaf50e243d937070d4 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 18 Dec 2024 20:55:39 +0000 Subject: [PATCH 10/12] Replace DI::app() with DI::appHelper() in Module\Api\Friendica namespace tests --- .../Module/Api/Friendica/DirectMessages/SearchTest.php | 6 +++--- tests/src/Module/Api/Friendica/NotificationTest.php | 4 ++-- tests/src/Module/Api/Friendica/Photo/DeleteTest.php | 8 ++++---- tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php | 6 +++--- tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php b/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php index 6b26b50ec3..27ea3e327d 100644 --- a/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php +++ b/tests/src/Module/Api/Friendica/DirectMessages/SearchTest.php @@ -19,7 +19,7 @@ class SearchTest extends ApiTestCase { $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); - $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); @@ -37,7 +37,7 @@ class SearchTest extends ApiTestCase $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); - $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'searchstring' => 'item_body' ]); @@ -58,7 +58,7 @@ class SearchTest extends ApiTestCase { $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); - $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'searchstring' => 'test' ]); diff --git a/tests/src/Module/Api/Friendica/NotificationTest.php b/tests/src/Module/Api/Friendica/NotificationTest.php index e05041acb6..c31b43d55d 100644 --- a/tests/src/Module/Api/Friendica/NotificationTest.php +++ b/tests/src/Module/Api/Friendica/NotificationTest.php @@ -52,7 +52,7 @@ class NotificationTest extends ApiTestCase XML; - $response = (new Notification(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) + $response = (new Notification(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) ->run($this->httpExceptionMock); self::assertXmlStringEqualsXmlString($assertXml, (string)$response->getBody()); @@ -64,7 +64,7 @@ XML; public function testWithJsonResult() { - $response = (new Notification(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Notification(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Friendica/Photo/DeleteTest.php b/tests/src/Module/Api/Friendica/Photo/DeleteTest.php index 1ba144011c..19d440cd70 100644 --- a/tests/src/Module/Api/Friendica/Photo/DeleteTest.php +++ b/tests/src/Module/Api/Friendica/Photo/DeleteTest.php @@ -25,7 +25,7 @@ class DeleteTest extends ApiTestCase public function testEmpty() { $this->expectException(BadRequestException::class); - (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock); + (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock); } public function testWithoutAuthenticatedUser() @@ -36,14 +36,14 @@ class DeleteTest extends ApiTestCase public function testWrong() { $this->expectException(BadRequestException::class); - (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]); + (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]); } public function testValidWithPost() { $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); - $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'photo_id' => '709057080661a283a6aa598501504178' ]); @@ -58,7 +58,7 @@ class DeleteTest extends ApiTestCase { $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); - $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'photo_id' => '709057080661a283a6aa598501504178' ]); diff --git a/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php b/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php index fae9c2cf4d..727ba63a2b 100644 --- a/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php +++ b/tests/src/Module/Api/Friendica/Photoalbum/DeleteTest.php @@ -25,7 +25,7 @@ class DeleteTest extends ApiTestCase public function testEmpty() { $this->expectException(BadRequestException::class); - (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -33,7 +33,7 @@ class DeleteTest extends ApiTestCase public function testWrong() { $this->expectException(BadRequestException::class); - (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'album' => 'album_name' ]); @@ -43,7 +43,7 @@ class DeleteTest extends ApiTestCase { $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); - $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Delete(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'album' => 'test_album'] ); diff --git a/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php b/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php index 0b5f71f2b1..6ac54c392b 100644 --- a/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php +++ b/tests/src/Module/Api/Friendica/Photoalbum/UpdateTest.php @@ -25,14 +25,14 @@ class UpdateTest extends ApiTestCase public function testEmpty() { $this->expectException(BadRequestException::class); - (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } public function testTooFewArgs() { $this->expectException(BadRequestException::class); - (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'album' => 'album_name' ]); @@ -41,7 +41,7 @@ class UpdateTest extends ApiTestCase public function testWrongUpdate() { $this->expectException(BadRequestException::class); - (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'album' => 'album_name', 'album_new' => 'album_name' @@ -57,7 +57,7 @@ class UpdateTest extends ApiTestCase { $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); - $response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'album' => 'test_album', 'album_new' => 'test_album_2' From ba65cad1cd997dd4f76fd9addd081d11a898c861 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 18 Dec 2024 21:06:55 +0000 Subject: [PATCH 11/12] Replace DI::app() with DI::appHelper() in more tests --- .../src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php | 2 +- .../src/Module/Api/GnuSocial/GnuSocial/VersionTest.php | 2 +- tests/src/Module/Api/GnuSocial/Help/TestTest.php | 4 ++-- .../Api/Mastodon/Accounts/VerifyCredentialsTest.php | 2 +- tests/src/Module/Api/Mastodon/PushSubscriptionTest.php | 2 +- .../Module/Api/Twitter/Account/RateLimitStatusTest.php | 4 ++-- .../Module/Api/Twitter/Account/UpdateProfileTest.php | 2 +- tests/src/Module/Api/Twitter/Blocks/ListsTest.php | 2 +- .../src/Module/Api/Twitter/DirectMessages/AllTest.php | 2 +- .../Api/Twitter/DirectMessages/ConversationTest.php | 2 +- .../Module/Api/Twitter/DirectMessages/DestroyTest.php | 10 +++++----- .../Module/Api/Twitter/DirectMessages/InboxTest.php | 2 +- .../Module/Api/Twitter/DirectMessages/NewDMTest.php | 10 +++++----- .../src/Module/Api/Twitter/DirectMessages/SentTest.php | 4 ++-- tests/src/Module/Api/Twitter/Favorites/CreateTest.php | 6 +++--- tests/src/Module/Api/Twitter/Favorites/DestroyTest.php | 4 ++-- tests/src/Module/Api/Twitter/Followers/ListsTest.php | 2 +- tests/src/Module/Api/Twitter/Friends/ListsTest.php | 2 +- .../Module/Api/Twitter/Friendships/IncomingTest.php | 2 +- tests/src/Module/Api/Twitter/Lists/StatusesTest.php | 2 +- tests/src/Module/Api/Twitter/Media/UploadTest.php | 8 ++++---- tests/src/Module/Api/Twitter/SavedSearchesTest.php | 2 +- tests/src/Module/Api/Twitter/Statuses/DestroyTest.php | 4 ++-- tests/src/Module/Api/Twitter/Statuses/MentionsTest.php | 6 +++--- tests/src/Module/Api/Twitter/Statuses/RetweetTest.php | 4 ++-- tests/src/Module/Api/Twitter/Statuses/ShowTest.php | 4 ++-- tests/src/Module/Api/Twitter/Statuses/UpdateTest.php | 4 ++-- .../Module/Api/Twitter/Statuses/UserTimelineTest.php | 4 ++-- tests/src/Module/Api/Twitter/Users/LookupTest.php | 2 +- tests/src/Module/Api/Twitter/Users/SearchTest.php | 2 +- tests/src/Module/Api/Twitter/Users/ShowTest.php | 4 ++-- 31 files changed, 56 insertions(+), 56 deletions(-) diff --git a/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php b/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php index 6c51c4d1e6..c38b045171 100644 --- a/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php +++ b/tests/src/Module/Api/GnuSocial/GnuSocial/ConfigTest.php @@ -18,7 +18,7 @@ class ConfigTest extends ApiTestCase */ public function testApiStatusnetConfig() { - $response = (new Config(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Config(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php b/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php index 099e052813..2f8f8c0508 100644 --- a/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php +++ b/tests/src/Module/Api/GnuSocial/GnuSocial/VersionTest.php @@ -16,7 +16,7 @@ class VersionTest extends ApiTestCase { public function test() { - $response = (new Version(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Version(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); self::assertEquals([ diff --git a/tests/src/Module/Api/GnuSocial/Help/TestTest.php b/tests/src/Module/Api/GnuSocial/Help/TestTest.php index 6ca274765c..b1bbd68aa0 100644 --- a/tests/src/Module/Api/GnuSocial/Help/TestTest.php +++ b/tests/src/Module/Api/GnuSocial/Help/TestTest.php @@ -16,7 +16,7 @@ class TestTest extends ApiTestCase { public function testJson() { - $response = (new Test(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Test(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $json = $this->toJson($response); @@ -30,7 +30,7 @@ class TestTest extends ApiTestCase public function testXml() { - $response = (new Test(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) + $response = (new Test(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) ->run($this->httpExceptionMock); self::assertEquals([ diff --git a/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php b/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php index ab4cdbc7dd..10702b8e4a 100644 --- a/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php +++ b/tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php @@ -20,7 +20,7 @@ class VerifyCredentialsTest extends ApiTestCase */ public function testApiAccountVerifyCredentials() { - $response = (new VerifyCredentials(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new VerifyCredentials(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php b/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php index 33e352d924..489bdd7b4a 100644 --- a/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php +++ b/tests/src/Module/Api/Mastodon/PushSubscriptionTest.php @@ -22,7 +22,7 @@ class PushSubscriptionTest extends ApiTestCase // $this->useHttpMethod(Router::POST); // - // $response = (new PushSubscription(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), DI::mstdnSubscription(), DI::mstdnError(), [])) + // $response = (new PushSubscription(DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), DI::mstdnSubscription(), DI::mstdnError(), [])) // ->run(); // // $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php b/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php index 89cd7da640..36b4162c4a 100644 --- a/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php +++ b/tests/src/Module/Api/Twitter/Account/RateLimitStatusTest.php @@ -16,7 +16,7 @@ class RateLimitStatusTest extends ApiTestCase { public function testWithJson() { - $response = (new RateLimitStatus(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new RateLimitStatus(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $result = $this->toJson($response); @@ -32,7 +32,7 @@ class RateLimitStatusTest extends ApiTestCase public function testWithXml() { - $response = (new RateLimitStatus(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) + $response = (new RateLimitStatus(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) ->run($this->httpExceptionMock); self::assertEquals([ diff --git a/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php b/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php index 3ba7a3d996..ccfcb8075f 100644 --- a/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php +++ b/tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php @@ -21,7 +21,7 @@ class UpdateProfileTest extends ApiTestCase { $this->useHttpMethod(Router::POST); - $response = (new UpdateProfile(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new UpdateProfile(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'name' => 'new_name', 'description' => 'new_description' diff --git a/tests/src/Module/Api/Twitter/Blocks/ListsTest.php b/tests/src/Module/Api/Twitter/Blocks/ListsTest.php index 0b5577ccd6..d98e490303 100644 --- a/tests/src/Module/Api/Twitter/Blocks/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Blocks/ListsTest.php @@ -18,7 +18,7 @@ class ListsTest extends ApiTestCase */ public function testApiStatusesFWithBlocks() { - $response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php b/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php index c4c1b7d7b9..8f180ff306 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/AllTest.php @@ -25,7 +25,7 @@ class AllTest extends ApiTestCase $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new All($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new All($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php index cec35927fa..1681ef0e51 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php @@ -23,7 +23,7 @@ class ConversationTest extends ApiTestCase { $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new Conversation($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Conversation($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'friendica_verbose' => true, ]); diff --git a/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php b/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php index 198eade10d..03a232ecbc 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php @@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase { $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class); - (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); } @@ -42,7 +42,7 @@ class DestroyTest extends ApiTestCase */ public function testApiDirectMessagesDestroyWithVerbose() { - $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'friendica_verbose' => true, ]); @@ -78,7 +78,7 @@ class DestroyTest extends ApiTestCase public function testApiDirectMessagesDestroyWithId() { $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class); - (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'id' => 1 ]); @@ -91,7 +91,7 @@ class DestroyTest extends ApiTestCase */ public function testApiDirectMessagesDestroyWithIdAndVerbose() { - $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'id' => 1, 'friendica_parenturi' => 'parent_uri', @@ -115,7 +115,7 @@ class DestroyTest extends ApiTestCase $ids = DBA::selectToArray('mail', ['id']); $id = $ids[0]['id']; - $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'id' => $id, 'friendica_verbose' => true, diff --git a/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php index a7e1861fc1..efed6f38c4 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php @@ -25,7 +25,7 @@ class InboxTest extends ApiTestCase $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new Inbox($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Inbox($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php b/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php index 33bf885751..d338d42685 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php @@ -31,7 +31,7 @@ class NewDMTest extends ApiTestCase { $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); self::assertEmpty((string)$response->getBody()); @@ -63,7 +63,7 @@ class NewDMTest extends ApiTestCase { $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'text' => 'message_text', 'user_id' => 43 @@ -85,7 +85,7 @@ class NewDMTest extends ApiTestCase $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'text' => 'message_text', 'user_id' => 44 @@ -109,7 +109,7 @@ class NewDMTest extends ApiTestCase $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'text' => 'message_text', 'user_id' => 44, @@ -135,7 +135,7 @@ class NewDMTest extends ApiTestCase $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) + $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) ->run($this->httpExceptionMock, [ 'text' => 'message_text', 'user_id' => 44, diff --git a/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php b/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php index 4e9de634b9..fa82a3645b 100644 --- a/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php +++ b/tests/src/Module/Api/Twitter/DirectMessages/SentTest.php @@ -23,7 +23,7 @@ class SentTest extends ApiTestCase { $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock, [ 'friendica_verbose' => true, ]); @@ -43,7 +43,7 @@ class SentTest extends ApiTestCase { $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); - $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) + $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) ->run($this->httpExceptionMock); self::assertXml((string)$response->getBody(), 'direct-messages'); diff --git a/tests/src/Module/Api/Twitter/Favorites/CreateTest.php b/tests/src/Module/Api/Twitter/Favorites/CreateTest.php index 3e2a4e34c3..5e7d43be82 100644 --- a/tests/src/Module/Api/Twitter/Favorites/CreateTest.php +++ b/tests/src/Module/Api/Twitter/Favorites/CreateTest.php @@ -32,7 +32,7 @@ class CreateTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -43,7 +43,7 @@ class CreateTest extends ApiTestCase */ public function testApiFavoritesCreateDestroyWithCreateAction() { - $response = (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 3 ]); @@ -60,7 +60,7 @@ class CreateTest extends ApiTestCase */ public function testApiFavoritesCreateDestroyWithCreateActionAndRss() { - $response = (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) + $response = (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) ->run($this->httpExceptionMock, [ 'id' => 3 ]); diff --git a/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php b/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php index 24567a6056..a99f195d2a 100644 --- a/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/Favorites/DestroyTest.php @@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -42,7 +42,7 @@ class DestroyTest extends ApiTestCase */ public function testApiFavoritesCreateDestroyWithDestroyAction() { - $response = (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 3 ]); diff --git a/tests/src/Module/Api/Twitter/Followers/ListsTest.php b/tests/src/Module/Api/Twitter/Followers/ListsTest.php index 63375393ad..ceb3578253 100644 --- a/tests/src/Module/Api/Twitter/Followers/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Followers/ListsTest.php @@ -18,7 +18,7 @@ class ListsTest extends ApiTestCase */ public function testApiStatusesFWithFollowers() { - $response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/Friends/ListsTest.php b/tests/src/Module/Api/Twitter/Friends/ListsTest.php index f80fb5cd3c..ca03f08d06 100644 --- a/tests/src/Module/Api/Twitter/Friends/ListsTest.php +++ b/tests/src/Module/Api/Twitter/Friends/ListsTest.php @@ -20,7 +20,7 @@ class ListsTest extends ApiTestCase */ public function testApiStatusesFWithFriends() { - $response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php b/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php index 305046edd1..8419cd072a 100644 --- a/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php +++ b/tests/src/Module/Api/Twitter/Friendships/IncomingTest.php @@ -20,7 +20,7 @@ class IncomingTest extends ApiTestCase */ public function testApiFriendshipsIncoming() { - $response = (new Incoming(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Incoming(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php index b934b6ef15..c4865b70ca 100644 --- a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php +++ b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php @@ -23,7 +23,7 @@ class StatusesTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } diff --git a/tests/src/Module/Api/Twitter/Media/UploadTest.php b/tests/src/Module/Api/Twitter/Media/UploadTest.php index ae64eab9ed..408edbf7f9 100644 --- a/tests/src/Module/Api/Twitter/Media/UploadTest.php +++ b/tests/src/Module/Api/Twitter/Media/UploadTest.php @@ -32,7 +32,7 @@ class UploadTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -46,7 +46,7 @@ class UploadTest extends ApiTestCase $this->expectException(UnauthorizedException::class); AuthTestConfig::$authenticated = false; - (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -65,7 +65,7 @@ class UploadTest extends ApiTestCase ] ]; - (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -88,7 +88,7 @@ class UploadTest extends ApiTestCase ] ]; - $response = (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $media = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/SavedSearchesTest.php b/tests/src/Module/Api/Twitter/SavedSearchesTest.php index 44ed89cd9a..db2e55213b 100644 --- a/tests/src/Module/Api/Twitter/SavedSearchesTest.php +++ b/tests/src/Module/Api/Twitter/SavedSearchesTest.php @@ -16,7 +16,7 @@ class SavedSearchesTest extends ApiTestCase { public function test() { - $response = (new SavedSearches(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) + $response = (new SavedSearches(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) ->run($this->httpExceptionMock); $result = $this->toJson($response); diff --git a/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php b/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php index ef3580df6e..4b82299b4f 100644 --- a/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/DestroyTest.php @@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -57,7 +57,7 @@ class DestroyTest extends ApiTestCase */ public function testApiStatusesDestroyWithId() { - $response = (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 1 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php b/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php index c27ce9ac09..2e31ae382b 100644 --- a/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/MentionsTest.php @@ -21,7 +21,7 @@ class MentionsTest extends ApiTestCase */ public function testApiStatusesMentions() { - $response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'max_id' => 10 ]); @@ -39,7 +39,7 @@ class MentionsTest extends ApiTestCase */ public function testApiStatusesMentionsWithNegativePage() { - $response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'page' => -2 ]); @@ -71,7 +71,7 @@ class MentionsTest extends ApiTestCase */ public function testApiStatusesMentionsWithRss() { - $response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) + $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) ->run($this->httpExceptionMock, [ 'page' => -2 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php index 7c5a8f7ad1..9ce207f45c 100644 --- a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php @@ -31,7 +31,7 @@ class RetweetTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Retweet(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Retweet(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -57,7 +57,7 @@ class RetweetTest extends ApiTestCase */ public function testApiStatusesRepeatWithId() { - $response = (new Retweet(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Retweet(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 1 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php index b4b83d0db0..c7b09cec6d 100644 --- a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php @@ -24,7 +24,7 @@ class ShowTest extends ApiTestCase $this->expectException(BadRequestException::class); - (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } @@ -35,7 +35,7 @@ class ShowTest extends ApiTestCase */ public function testApiStatusesShowWithId() { - $response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 1 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php b/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php index 74663091ee..d044c900dd 100644 --- a/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/UpdateTest.php @@ -40,7 +40,7 @@ class UpdateTest extends ApiTestCase ] ]; - $response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'status' => 'Status content #friendica', 'in_reply_to_status_id' => 0, @@ -62,7 +62,7 @@ class UpdateTest extends ApiTestCase */ public function testApiStatusesUpdateWithHtml() { - $response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'htmlstatus' => 'Status content', ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php index a9532572ee..ea2ba48f33 100644 --- a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php @@ -21,7 +21,7 @@ class UserTimelineTest extends ApiTestCase */ public function testApiStatusesUserTimeline() { - $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new UserTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'user_id' => 43, // Public contact id 'max_id' => 10, @@ -69,7 +69,7 @@ class UserTimelineTest extends ApiTestCase */ public function testApiStatusesUserTimelineWithRss() { - $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ + $response = (new UserTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ 'extension' => ICanCreateResponses::TYPE_RSS ]))->run($this->httpExceptionMock); diff --git a/tests/src/Module/Api/Twitter/Users/LookupTest.php b/tests/src/Module/Api/Twitter/Users/LookupTest.php index 3ffe248b17..509767c2ea 100644 --- a/tests/src/Module/Api/Twitter/Users/LookupTest.php +++ b/tests/src/Module/Api/Twitter/Users/LookupTest.php @@ -23,7 +23,7 @@ class LookupTest extends ApiTestCase { $this->expectException(NotFoundException::class); - (new Lookup(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Lookup(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } diff --git a/tests/src/Module/Api/Twitter/Users/SearchTest.php b/tests/src/Module/Api/Twitter/Users/SearchTest.php index 9ee4c06380..42ad97dec9 100644 --- a/tests/src/Module/Api/Twitter/Users/SearchTest.php +++ b/tests/src/Module/Api/Twitter/Users/SearchTest.php @@ -57,7 +57,7 @@ class SearchTest extends ApiTestCase { $this->expectException(BadRequestException::class); - (new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + (new Search(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); } } diff --git a/tests/src/Module/Api/Twitter/Users/ShowTest.php b/tests/src/Module/Api/Twitter/Users/ShowTest.php index 267954de76..d44db14ef2 100644 --- a/tests/src/Module/Api/Twitter/Users/ShowTest.php +++ b/tests/src/Module/Api/Twitter/Users/ShowTest.php @@ -21,7 +21,7 @@ class ShowTest extends ApiTestCase */ public function testApiUsersShow() { - $response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock); $json = $this->toJson($response); @@ -41,7 +41,7 @@ class ShowTest extends ApiTestCase */ public function testApiUsersShowWithXml() { - $response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ + $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ 'extension' => ICanCreateResponses::TYPE_XML ]))->run($this->httpExceptionMock); From a583cc9b0ecd54bb780b97c659c73ce360809e57 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 18 Dec 2024 21:19:01 +0000 Subject: [PATCH 12/12] replace more calls of DI::app(), add workaround for tests --- tests/src/Factory/Api/Twitter/StatusTest.php | 2 +- tests/src/Module/Api/Twitter/FavoritesTest.php | 11 +++++++++-- .../Module/Api/Twitter/Lists/StatusesTest.php | 11 +++++++++-- .../Statuses/NetworkPublicTimelineTest.php | 16 +++++++++++++--- .../Module/Api/Twitter/Statuses/RetweetTest.php | 6 +++++- .../src/Module/Api/Twitter/Statuses/ShowTest.php | 6 +++++- .../Api/Twitter/Statuses/UserTimelineTest.php | 6 +++++- .../src/Module/Api/Twitter/Users/LookupTest.php | 6 +++++- .../src/Module/Api/Twitter/Users/SearchTest.php | 11 +++++++++-- 9 files changed, 61 insertions(+), 14 deletions(-) diff --git a/tests/src/Factory/Api/Twitter/StatusTest.php b/tests/src/Factory/Api/Twitter/StatusTest.php index c18d6838ce..5a00d5177f 100644 --- a/tests/src/Factory/Api/Twitter/StatusTest.php +++ b/tests/src/Factory/Api/Twitter/StatusTest.php @@ -124,7 +124,7 @@ class StatusTest extends FixtureTestCase */ public function testApiFormatItems() { - // This call is needed for this test + // @todo: This call is needed for this test Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); $posts = DI::dba()->selectToArray('post-view', ['uri-id']); diff --git a/tests/src/Module/Api/Twitter/FavoritesTest.php b/tests/src/Module/Api/Twitter/FavoritesTest.php index 1999ffe93e..7734a6c629 100644 --- a/tests/src/Module/Api/Twitter/FavoritesTest.php +++ b/tests/src/Module/Api/Twitter/FavoritesTest.php @@ -8,6 +8,7 @@ namespace Friendica\Test\src\Module\Api\Twitter; use Friendica\Capabilities\ICanCreateResponses; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Favorites; use Friendica\Test\ApiTestCase; @@ -21,7 +22,10 @@ class FavoritesTest extends ApiTestCase */ public function testApiFavorites() { - $response = (new Favorites(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Favorites(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'page' => -1, 'max_id' => 10, @@ -41,7 +45,10 @@ class FavoritesTest extends ApiTestCase */ public function testApiFavoritesWithRss() { - $response = (new Favorites(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Favorites(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ 'extension' => ICanCreateResponses::TYPE_RSS ]))->run($this->httpExceptionMock); diff --git a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php index c4865b70ca..add9bbe6d2 100644 --- a/tests/src/Module/Api/Twitter/Lists/StatusesTest.php +++ b/tests/src/Module/Api/Twitter/Lists/StatusesTest.php @@ -7,6 +7,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Lists; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Lists\Statuses; use Friendica\Network\HTTPException\BadRequestException; @@ -32,7 +33,10 @@ class StatusesTest extends ApiTestCase */ public function testApiListsStatusesWithListId() { - $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'list_id' => 1, 'page' => -1, @@ -52,7 +56,10 @@ class StatusesTest extends ApiTestCase */ public function testApiListsStatusesWithListIdAndRss() { - $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) ->run($this->httpExceptionMock, [ 'list_id' => 1 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php b/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php index 9047f94683..52db7b76de 100644 --- a/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/NetworkPublicTimelineTest.php @@ -8,6 +8,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses; use Friendica\Capabilities\ICanCreateResponses; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\NetworkPublicTimeline; use Friendica\Test\ApiTestCase; @@ -21,7 +22,10 @@ class NetworkPublicTimelineTest extends ApiTestCase */ public function testApiStatusesNetworkpublicTimeline() { - $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'max_id' => 10 ]); @@ -43,7 +47,10 @@ class NetworkPublicTimelineTest extends ApiTestCase */ public function testApiStatusesNetworkpublicTimelineWithNegativePage() { - $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'page' => -2 ]); @@ -79,7 +86,10 @@ class NetworkPublicTimelineTest extends ApiTestCase */ public function testApiStatusesNetworkpublicTimelineWithRss() { - $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ 'extension' => ICanCreateResponses::TYPE_RSS ]))->run($this->httpExceptionMock, [ 'page' => -2 diff --git a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php index 9ce207f45c..b8a7a50428 100644 --- a/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/RetweetTest.php @@ -8,6 +8,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses; use Friendica\App\Router; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Retweet; use Friendica\Network\HTTPException\BadRequestException; @@ -74,7 +75,10 @@ class RetweetTest extends ApiTestCase */ public function testApiStatusesRepeatWithSharedId() { - $response = (new Retweet(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Retweet(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 5 ]); diff --git a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php index c7b09cec6d..68df218a32 100644 --- a/tests/src/Module/Api/Twitter/Statuses/ShowTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/ShowTest.php @@ -7,6 +7,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\Show; use Friendica\Network\HTTPException\BadRequestException; @@ -53,7 +54,10 @@ class ShowTest extends ApiTestCase */ public function testApiStatusesShowWithConversation() { - $response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'id' => 1, 'conversation' => 1 diff --git a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php index ea2ba48f33..aeadede16c 100644 --- a/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php +++ b/tests/src/Module/Api/Twitter/Statuses/UserTimelineTest.php @@ -8,6 +8,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses; use Friendica\Capabilities\ICanCreateResponses; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Statuses\UserTimeline; use Friendica\Test\ApiTestCase; @@ -46,7 +47,10 @@ class UserTimelineTest extends ApiTestCase */ public function testApiStatusesUserTimelineWithNegativePage() { - $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new UserTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'user_id' => 43, // Public contact id 'page' => -2, diff --git a/tests/src/Module/Api/Twitter/Users/LookupTest.php b/tests/src/Module/Api/Twitter/Users/LookupTest.php index 509767c2ea..aa53cce5cb 100644 --- a/tests/src/Module/Api/Twitter/Users/LookupTest.php +++ b/tests/src/Module/Api/Twitter/Users/LookupTest.php @@ -7,6 +7,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Users; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Users\Lookup; use Friendica\Network\HTTPException\NotFoundException; @@ -34,7 +35,10 @@ class LookupTest extends ApiTestCase */ public function testApiUsersLookupWithUserId() { - $response = (new Lookup(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Lookup(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'user_id' => static::OTHER_USER['id'] ]); diff --git a/tests/src/Module/Api/Twitter/Users/SearchTest.php b/tests/src/Module/Api/Twitter/Users/SearchTest.php index 42ad97dec9..c5996a5345 100644 --- a/tests/src/Module/Api/Twitter/Users/SearchTest.php +++ b/tests/src/Module/Api/Twitter/Users/SearchTest.php @@ -8,6 +8,7 @@ namespace Friendica\Test\src\Module\Api\Twitter\Users; use Friendica\Capabilities\ICanCreateResponses; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Module\Api\Twitter\Users\Search; use Friendica\Network\HTTPException\BadRequestException; @@ -22,7 +23,10 @@ class SearchTest extends ApiTestCase */ public function testApiUsersSearch() { - $response = (new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Search(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) ->run($this->httpExceptionMock, [ 'q' => static::OTHER_USER['name'] ]); @@ -39,7 +43,10 @@ class SearchTest extends ApiTestCase */ public function testApiUsersSearchWithXml() { - $response = (new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ + // @todo: This call is needed for this test + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $response = (new Search(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ 'extension' => ICanCreateResponses::TYPE_XML ]))->run($this->httpExceptionMock, [ 'q' => static::OTHER_USER['name']