Fix ApiResponseTest
This commit is contained in:
parent
b4cb5631ad
commit
8135c49613
1 changed files with 12 additions and 10 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue