Fix ApiResponseTest

This commit is contained in:
Philipp Holzer 2021-11-21 11:45:50 +01:00
parent b4cb5631ad
commit 8135c49613
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432

View file

@ -3,7 +3,9 @@
namespace Friendica\Test\src\Module\Api; namespace Friendica\Test\src\Module\Api;
use Friendica\App\Arguments; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Twitter\User;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTest;
use Friendica\Test\Util\ApiResponseDouble; use Friendica\Test\Util\ApiResponseDouble;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
@ -22,8 +24,8 @@ class ApiResponseTest extends MockedTest
$l10n = \Mockery::mock(L10n::class); $l10n = \Mockery::mock(L10n::class);
$args = \Mockery::mock(Arguments::class); $args = \Mockery::mock(Arguments::class);
$args->shouldReceive('getQueryString')->andReturn(''); $args->shouldReceive('getQueryString')->andReturn('');
$baseUrl = \Mockery::mock(Friendica\App\BaseURL::class); $baseUrl = \Mockery::mock(BaseURL::class);
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class); $twitterUser = \Mockery::mock(User::class);
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser); $response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
$response->error(200, 'OK', 'error_message', 'json'); $response->error(200, 'OK', 'error_message', 'json');
@ -36,8 +38,8 @@ class ApiResponseTest extends MockedTest
$l10n = \Mockery::mock(L10n::class); $l10n = \Mockery::mock(L10n::class);
$args = \Mockery::mock(Arguments::class); $args = \Mockery::mock(Arguments::class);
$args->shouldReceive('getQueryString')->andReturn(''); $args->shouldReceive('getQueryString')->andReturn('');
$baseUrl = \Mockery::mock(Friendica\App\BaseURL::class); $baseUrl = \Mockery::mock(BaseURL::class);
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class); $twitterUser = \Mockery::mock(User::class);
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser); $response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
$response->error(200, 'OK', 'error_message', 'xml'); $response->error(200, 'OK', 'error_message', 'xml');
@ -58,8 +60,8 @@ class ApiResponseTest extends MockedTest
$l10n = \Mockery::mock(L10n::class); $l10n = \Mockery::mock(L10n::class);
$args = \Mockery::mock(Arguments::class); $args = \Mockery::mock(Arguments::class);
$args->shouldReceive('getQueryString')->andReturn(''); $args->shouldReceive('getQueryString')->andReturn('');
$baseUrl = \Mockery::mock(Friendica\App\BaseURL::class); $baseUrl = \Mockery::mock(BaseURL::class);
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class); $twitterUser = \Mockery::mock(User::class);
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser); $response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
$response->error(200, 'OK', 'error_message', 'rss'); $response->error(200, 'OK', 'error_message', 'rss');
@ -81,8 +83,8 @@ class ApiResponseTest extends MockedTest
$l10n = \Mockery::mock(L10n::class); $l10n = \Mockery::mock(L10n::class);
$args = \Mockery::mock(Arguments::class); $args = \Mockery::mock(Arguments::class);
$args->shouldReceive('getQueryString')->andReturn(''); $args->shouldReceive('getQueryString')->andReturn('');
$baseUrl = \Mockery::mock(Friendica\App\BaseURL::class); $baseUrl = \Mockery::mock(BaseURL::class);
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class); $twitterUser = \Mockery::mock(User::class);
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser); $response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
$response->error(200, 'OK', 'error_message', 'atom'); $response->error(200, 'OK', 'error_message', 'atom');
@ -107,8 +109,8 @@ class ApiResponseTest extends MockedTest
}); });
$args = \Mockery::mock(Arguments::class); $args = \Mockery::mock(Arguments::class);
$args->shouldReceive('getQueryString')->andReturn(''); $args->shouldReceive('getQueryString')->andReturn('');
$baseUrl = \Mockery::mock(Friendica\App\BaseURL::class); $baseUrl = \Mockery::mock(BaseURL::class);
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class); $twitterUser = \Mockery::mock(User::class);
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser); $response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
$response->unsupported(); $response->unsupported();