rename and move ApiTest to ApiTestCase

This commit is contained in:
Art4 2024-12-13 22:42:27 +00:00
parent cb6269eddb
commit 9f8023b91f
49 changed files with 113 additions and 116 deletions

View file

@ -5,26 +5,23 @@
// //
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\src\Module\Api; namespace Friendica\Test;
use Friendica\App; use Friendica\App;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Special\HTTPException; use Friendica\Module\Special\HTTPException;
use Friendica\Security\Authentication; use Friendica\Security\Authentication;
use Friendica\Security\BasicAuth; use Friendica\Security\BasicAuth;
use Friendica\Test\FixtureTestCase;
use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AppDouble;
use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthenticationDouble;
use Friendica\Test\Util\AuthTestConfig; use Friendica\Test\Util\AuthTestConfig;
use Mockery\MockInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
abstract class ApiTest extends FixtureTestCase abstract class ApiTestCase extends FixtureTestCase
{ {
// User data that the test database is populated with // User data that the test database is populated with
const SELF_USER = [ const SELF_USER = [

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Account\RateLimitStatus; 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() public function testWithJson()
{ {

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Account;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Account\UpdateProfile; 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. * Test the api_account_update_profile() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Blocks;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Blocks\Lists; 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. * Test the api_statuses_f() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\DirectMessages;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\DirectMessages\All; use Friendica\Module\Api\Twitter\DirectMessages\All;
use Friendica\Factory\Api\Twitter\DirectMessage; 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. * Test the api_direct_messages_box() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Twitter\DirectMessages\Conversation; 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. * Test the api_direct_messages_box() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\DirectMessages\Destroy; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Twitter\DirectMessages\Inbox; 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. * Test the api_direct_messages_box() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Twitter\DirectMessages\NewDM; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Twitter\DirectMessages\Sent; 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. * Test the api_direct_messages_box() function.

View file

@ -12,9 +12,9 @@ use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Favorites\Create; use Friendica\Module\Api\Twitter\Favorites\Create;
use Friendica\Network\HTTPException\BadRequestException; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Favorites\Destroy; use Friendica\Module\Api\Twitter\Favorites\Destroy;
use Friendica\Network\HTTPException\BadRequestException; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Favorites; 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. * Test the api_favorites() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Followers;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Followers\Lists; 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. * Test the api_statuses_f() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Friends;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Friends\Lists; 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. * Test the api_statuses_f() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Friendships;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Friendships\Incoming; 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. * Test the api_friendships_incoming() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Lists\Statuses; use Friendica\Module\Api\Twitter\Lists\Statuses;
use Friendica\Network\HTTPException\BadRequestException; 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. * Test the api_lists_statuses() function.

View file

@ -13,10 +13,10 @@ use Friendica\Module\Api\Twitter\Media\Upload;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Network\HTTPException\UnauthorizedException; use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\ApiTestCase;
use Friendica\Test\Util\AuthTestConfig; use Friendica\Test\Util\AuthTestConfig;
class UploadTest extends ApiTest class UploadTest extends ApiTestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\SavedSearches; 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() public function test()
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\Destroy; use Friendica\Module\Api\Twitter\Statuses\Destroy;
use Friendica\Network\HTTPException\BadRequestException; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\Mentions; 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. * Test the api_statuses_mentions() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\NetworkPublicTimeline; 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. * Test the api_statuses_networkpublic_timeline() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\Retweet; use Friendica\Module\Api\Twitter\Statuses\Retweet;
use Friendica\Network\HTTPException\BadRequestException; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\Show; use Friendica\Module\Api\Twitter\Statuses\Show;
use Friendica\Network\HTTPException\BadRequestException; 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. * Test the api_statuses_show() function.

View file

@ -10,9 +10,9 @@ namespace Friendica\Test\src\Module\Api\Twitter\Statuses;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\Update; 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 protected function setUp(): void
{ {

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Statuses\UserTimeline; 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. * Test the api_statuses_user_timeline() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Users\Lookup; use Friendica\Module\Api\Twitter\Users\Lookup;
use Friendica\Network\HTTPException\NotFoundException; 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. * Test the api_users_lookup() function.

View file

@ -12,9 +12,9 @@ use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Users\Search; use Friendica\Module\Api\Twitter\Users\Search;
use Friendica\Network\HTTPException\BadRequestException; 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. * Test the api_users_search() function.

View file

@ -11,9 +11,9 @@ use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Api\Twitter\Users\Show; 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. * Test the api_users_show() function.

View file

@ -8,9 +8,9 @@
namespace Friendica\Test\src\Module; namespace Friendica\Test\src\Module;
use Friendica\Module\BaseApi; 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() public function testWithWrongAuth()
{ {

View file

@ -8,9 +8,9 @@
namespace Friendica\Test\src\Security; namespace Friendica\Test\src\Security;
use Friendica\Security\BasicAuth; 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. * Test the api_source() function.