mirror of
https://github.com/friendica/friendica
synced 2024-11-09 16:22:56 +00:00
Possibly fixing tests
This commit is contained in:
parent
0e5f876680
commit
8abf6c9dd0
1 changed files with 15 additions and 5 deletions
|
@ -22,8 +22,10 @@ class ApiResponseTest extends MockedTest
|
|||
$l10n = \Mockery::mock(L10n::class);
|
||||
$args = \Mockery::mock(Arguments::class);
|
||||
$args->shouldReceive('getQueryString')->andReturn('');
|
||||
$baseUrl = \Mockery::mock(BaseURL::class);
|
||||
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class);
|
||||
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger());
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
|
||||
$response->error(200, 'OK', 'error_message', 'json');
|
||||
|
||||
self::assertEquals('{"error":"error_message","code":"200 OK","request":""}', ApiResponseDouble::getOutput());
|
||||
|
@ -34,8 +36,10 @@ class ApiResponseTest extends MockedTest
|
|||
$l10n = \Mockery::mock(L10n::class);
|
||||
$args = \Mockery::mock(Arguments::class);
|
||||
$args->shouldReceive('getQueryString')->andReturn('');
|
||||
$baseUrl = \Mockery::mock(BaseURL::class);
|
||||
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class);
|
||||
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger());
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
|
||||
$response->error(200, 'OK', 'error_message', 'xml');
|
||||
|
||||
self::assertEquals('<?xml version="1.0"?>' . "\n" .
|
||||
|
@ -54,8 +58,10 @@ class ApiResponseTest extends MockedTest
|
|||
$l10n = \Mockery::mock(L10n::class);
|
||||
$args = \Mockery::mock(Arguments::class);
|
||||
$args->shouldReceive('getQueryString')->andReturn('');
|
||||
$baseUrl = \Mockery::mock(BaseURL::class);
|
||||
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class);
|
||||
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger());
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
|
||||
$response->error(200, 'OK', 'error_message', 'rss');
|
||||
|
||||
self::assertEquals(
|
||||
|
@ -75,8 +81,10 @@ class ApiResponseTest extends MockedTest
|
|||
$l10n = \Mockery::mock(L10n::class);
|
||||
$args = \Mockery::mock(Arguments::class);
|
||||
$args->shouldReceive('getQueryString')->andReturn('');
|
||||
$baseUrl = \Mockery::mock(BaseURL::class);
|
||||
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class);
|
||||
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger());
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
|
||||
$response->error(200, 'OK', 'error_message', 'atom');
|
||||
|
||||
self::assertEquals(
|
||||
|
@ -99,8 +107,10 @@ class ApiResponseTest extends MockedTest
|
|||
});
|
||||
$args = \Mockery::mock(Arguments::class);
|
||||
$args->shouldReceive('getQueryString')->andReturn('');
|
||||
$baseUrl = \Mockery::mock(BaseURL::class);
|
||||
$twitterUser = \Mockery::mock(Friendica\Factory\Api\Twitter\User::class);
|
||||
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger());
|
||||
$response = new ApiResponseDouble($l10n, $args, new NullLogger(), $baseUrl, $twitterUser);
|
||||
$response->unsupported();
|
||||
|
||||
self::assertEquals('{"error":"API endpoint %s %s is not implemented","error_description":"The API endpoint is currently not implemented but might be in the future."}', ApiResponseDouble::getOutput());
|
||||
|
|
Loading…
Reference in a new issue