Merge branch 'develop' into restore-github-actions

This commit is contained in:
Art4 2024-12-22 07:02:24 +00:00
commit 9803bd731c
45 changed files with 215 additions and 412 deletions

View file

@ -8,6 +8,7 @@ parameters:
paths:
- addon/
- src/
- index.php
excludePaths:
analyse:

View file

@ -15,28 +15,18 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
$request = \GuzzleHttp\Psr7\ServerRequest::fromGlobals();
$dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]);
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $request->getServerParams()], Dice::CHAIN_CALL]]]);
\Friendica\DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
$a = \Friendica\DI::app();
$a = \Friendica\App::fromDice($dice);
\Friendica\DI::mode()->setExecutor(\Friendica\App\Mode::INDEX);
$a->runFrontend(
$dice->create(\Friendica\App\Router::class),
$dice->create(\Friendica\Core\PConfig\Capability\IManagePersonalConfigValues::class),
$dice->create(\Friendica\Security\Authentication::class),
$dice->create(\Friendica\App\Page::class),
$dice->create(\Friendica\Content\Nav::class),
$dice->create(Friendica\Module\Special\HTTPException::class),
new \Friendica\Util\HTTPInputData($_SERVER),
$start_time,
$_SERVER
);
$a->processRequest($request, $start_time);

View file

@ -7,7 +7,7 @@
namespace Friendica;
use Exception;
use Dice\Dice;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
@ -21,9 +21,7 @@ use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Definition\DbaDefinition;
use Friendica\Database\Definition\ViewDefinition;
use Friendica\Module\Maintenance;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Security\Authentication;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\L10n;
@ -36,6 +34,7 @@ use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPInputData;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Profiler;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\LoggerInterface;
/**
@ -48,12 +47,22 @@ use Psr\Log\LoggerInterface;
* before we spit the page out.
*
*/
class App implements AppHelper
class App
{
const PLATFORM = 'Friendica';
const CODENAME = 'Yellow Archangel';
const VERSION = '2024.12-dev';
public static function fromDice(Dice $dice): self
{
return new self($dice);
}
/**
* @var Dice
*/
private $container;
/**
* @var Mode The Mode of the Application
*/
@ -105,198 +114,48 @@ class App implements AppHelper
*/
private $appHelper;
public function __construct(
Request $request,
Authentication $auth,
IManageConfigValues $config,
Mode $mode,
BaseURL $baseURL,
LoggerInterface $logger,
Profiler $profiler,
L10n $l10n,
Arguments $args,
IHandleUserSessions $session,
DbaDefinition $dbaDefinition,
ViewDefinition $viewDefinition
) {
$this->requestId = $request->getRequestId();
$this->auth = $auth;
$this->config = $config;
$this->mode = $mode;
$this->baseURL = $baseURL;
$this->profiler = $profiler;
$this->logger = $logger;
$this->l10n = $l10n;
$this->args = $args;
$this->session = $session;
$this->appHelper = DI::appHelper();
$this->load($dbaDefinition, $viewDefinition);
private function __construct(Dice $container)
{
$this->container = $container;
}
/**
* Set the profile owner ID
*
* @deprecated 2024.12 Use AppHelper::setProfileOwner() instead
*
* @param int $owner_id
* @return void
*/
public function setProfileOwner(int $owner_id)
public function processRequest(ServerRequestInterface $request, float $start_time): void
{
$this->appHelper->setProfileOwner($owner_id);
}
$this->requestId = $this->container->create(Request::class)->getRequestId();
$this->auth = $this->container->create(Authentication::class);
$this->config = $this->container->create(IManageConfigValues::class);
$this->mode = $this->container->create(Mode::class);
$this->baseURL = $this->container->create(BaseURL::class);
$this->logger = $this->container->create(LoggerInterface::class);
$this->profiler = $this->container->create(Profiler::class);
$this->l10n = $this->container->create(L10n::class);
$this->args = $this->container->create(Arguments::class);
$this->session = $this->container->create(IHandleUserSessions::class);
$this->appHelper = $this->container->create(AppHelper::class);
/**
* Get the profile owner ID
*
* @deprecated 2024.12 Use AppHelper::getProfileOwner() instead
*
* @return int
*/
public function getProfileOwner(): int
{
return $this->appHelper->getProfileOwner();
}
$this->load(
$this->container->create(DbaDefinition::class),
$this->container->create(ViewDefinition::class),
);
/**
* Set the contact ID
*
* @deprecated 2024.12 Use AppHelper::setContactId() instead
*
* @param int $contact_id
* @return void
*/
public function setContactId(int $contact_id)
{
$this->appHelper->setContactId($contact_id);
}
$this->mode->setExecutor(Mode::INDEX);
/**
* Get the contact ID
*
* @deprecated 2024.12 Use AppHelper::getContactId() instead
*
* @return int
*/
public function getContactId(): int
{
return $this->appHelper->getContactId();
}
/**
* Set the timezone
*
* @deprecated 2024.12 Use AppHelper::setTimeZone() instead
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
* @return void
*/
public function setTimeZone(string $timezone)
{
$this->appHelper->setTimeZone($timezone);
}
/**
* Get the timezone
*
* @deprecated 2024.12 Use AppHelper::getTimeZone() instead
*/
public function getTimeZone(): string
{
return $this->appHelper->getTimeZone();
}
/**
* Set workerqueue information
*
* @deprecated 2024.12 Use AppHelper::setQueue() instead
*
* @param array $queue
* @return void
*/
public function setQueue(array $queue)
{
$this->appHelper->setQueue($queue);
}
/**
* Fetch workerqueue information
*
* @deprecated 2024.12 Use AppHelper::getQueue() instead
*
* @return array Worker queue
*/
public function getQueue(): array
{
return $this->appHelper->getQueue();
}
/**
* Fetch a specific workerqueue field
*
* @deprecated 2024.12 Use AppHelper::getQueueValue() instead
*
* @param string $index Work queue record to fetch
* @return mixed Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
{
return $this->appHelper->getQueueValue($index);
}
/**
* @deprecated 2024.12 Use AppHelper::setThemeInfoValue() instead
*/
public function setThemeInfoValue(string $index, $value)
{
$this->appHelper->setThemeInfoValue($index, $value);
}
/**
* @deprecated 2024.12 Use AppHelper::getThemeInfo() instead
*/
public function getThemeInfo()
{
return $this->appHelper->getThemeInfo();
}
/**
* @deprecated 2024.12 Use AppHelper::getThemeInfoValue() instead
*/
public function getThemeInfoValue(string $index, $default = null)
{
return $this->appHelper->getThemeInfoValue($index, $default);
}
/**
* Returns the current config cache of this node
*
* @deprecated 2024.12 Use AppHelper::getConfigCache() instead
*
* @return Cache
*/
public function getConfigCache()
{
return $this->appHelper->getConfigCache();
}
/**
* The basepath of this app
*
* @deprecated 2024.12 Use AppHelper::getBasePath() instead
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->appHelper->getBasePath();
$this->runFrontend(
$this->container->create(Router::class),
$this->container->create(IManagePersonalConfigValues::class),
$this->container->create(Page::class),
$this->container->create(Nav::class),
$this->container->create(ModuleHTTPException::class),
new HTTPInputData($request->getServerParams()),
$start_time,
$request->getServerParams()
);
}
/**
* Load the whole app instance
*/
protected function load(DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
private function load(DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
{
if ($this->config->get('system', 'ini_max_execution_time') !== false) {
set_time_limit((int)$this->config->get('system', 'ini_max_execution_time'));
@ -350,69 +209,6 @@ class App implements AppHelper
$this->appHelper->setTimeZone($timezone);
}
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @deprecated 2024.12 Use AppHelper::getCurrentTheme() instead
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string
{
return $this->appHelper->getCurrentTheme();
}
/**
* Returns the current mobile theme name.
*
* @deprecated 2024.12 Use AppHelper::getCurrentMobileTheme() instead
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string
{
return $this->appHelper->getCurrentMobileTheme();
}
/**
* Setter for current theme name
*
* @deprecated 2024.12 Use AppHelper::setCurrentTheme() instead
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme)
{
$this->appHelper->setCurrentTheme($theme);
}
/**
* Setter for current mobile theme name
*
* @deprecated 2024.12 Use AppHelper::setCurrentMobileTheme() instead
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme)
{
$this->appHelper->setCurrentMobileTheme($theme);
}
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @deprecated 2024.12 Use AppHelper::getCurrentThemeStylesheetPath() instead
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string
{
return $this->appHelper->getCurrentThemeStylesheetPath();
}
/**
* Frontend App script
*
@ -423,7 +219,6 @@ class App implements AppHelper
*
* @param Router $router
* @param IManagePersonalConfigValues $pconfig
* @param Authentication $auth The Authentication backend of the node
* @param Page $page The Friendica page printing container
* @param ModuleHTTPException $httpException The possible HTTP Exception container
* @param HTTPInputData $httpInput A library for processing PHP input streams
@ -433,10 +228,9 @@ class App implements AppHelper
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function runFrontend(
private function runFrontend(
Router $router,
IManagePersonalConfigValues $pconfig,
Authentication $auth,
Page $page,
Nav $nav,
ModuleHTTPException $httpException,
@ -504,7 +298,7 @@ class App implements AppHelper
}
if (!$this->mode->isBackend()) {
$auth->withSession();
$this->auth->withSession();
}
if ($this->session->isUnauthenticated()) {
@ -591,7 +385,7 @@ class App implements AppHelper
// Wrapping HTML responses in the theme template
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
$response = $page->run($this, $this->session, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId());
$response = $page->run($this->appHelper, $this->session, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId());
}
$this->logger->debug('Request processed sucessfully', ['response' => $response->getStatusCode(), 'address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]);
@ -605,21 +399,6 @@ class App implements AppHelper
$page->logRuntime($this->config, 'runFrontend');
}
/**
* Automatically redirects to relative or absolute URL
* Should only be used if it isn't clear if the URL is either internal or external
*
* @deprecated 2024.12 Use AppHelper::redirect() instead
*
* @param string $toUrl The target URL
*
* @throws InternalServerErrorException
*/
public function redirect(string $toUrl)
{
$this->appHelper->redirect($toUrl);
}
/**
* Log slow page executions
*

View file

@ -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;
@ -193,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 */

27
tests/Unit/AppTest.php Normal file
View file

@ -0,0 +1,27 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types = 1);
namespace Friendica\Test\Unit;
use Dice\Dice;
use Friendica\App;
use PHPUnit\Framework\TestCase;
class AppTest extends TestCase
{
public function testFromDiceReturnsApp(): void
{
$dice = $this->createMock(Dice::class);
$dice->expects($this->never())->method('create');
$app = App::fromDice($dice);
$this->assertInstanceOf(App::class, $app);
}
}

View file

@ -1,36 +0,0 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica\Test\Util;
use Friendica\App;
/**
* Making the App class overridable for specific situations
*
* @see App
*/
class AppDouble extends App
{
/** @var bool Marks/Overwrites if the user is currently logged in */
protected $isLoggedIn = false;
/**
* Manually overwrite the "isLoggedIn" behavior
*
* @param bool $isLoggedIn
*/
public function setIsLoggedIn(bool $isLoggedIn)
{
$this->isLoggedIn = $isLoggedIn;
}
public function isLoggedIn(): bool
{
return $this->isLoggedIn;
}
}

View file

@ -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']);

View file

@ -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'
]);

View file

@ -52,7 +52,7 @@ class NotificationTest extends ApiTestCase
</notes>
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);

View file

@ -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'
]);

View file

@ -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']
);

View file

@ -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'

View file

@ -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);

View file

@ -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([

View file

@ -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([

View file

@ -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);

View file

@ -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);

View file

@ -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([

View file

@ -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'

View file

@ -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);

View file

@ -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);

View file

@ -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,
]);

View file

@ -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,

View file

@ -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);

View file

@ -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,

View file

@ -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');

View file

@ -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
]);

View file

@ -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
]);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;
@ -23,7 +24,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);
}
@ -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
]);

View file

@ -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);

View file

@ -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);

View file

@ -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
]);

View file

@ -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
]);

View file

@ -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

View file

@ -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;
@ -31,7 +32,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 +58,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
]);
@ -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
]);

View file

@ -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;
@ -24,7 +25,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 +36,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
]);
@ -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

View file

@ -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' => '<b>Status content</b>',
]);

View file

@ -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;
@ -21,7 +22,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,
@ -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,
@ -69,7 +73,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);

View file

@ -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;
@ -23,7 +24,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);
}
@ -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']
]);

View file

@ -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']
@ -57,7 +64,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);
}
}

View file

@ -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);