self::assertModule([
'isBackend' => false,
'name' => App\ModuleController::DEFAULT,
- 'class' => new $defaultClass(),
+ 'class' => null,
], $module);
}
'name' => App\ModuleController::DEFAULT,
'command' => App\ModuleController::DEFAULT,
'privAdd' => false,
- 'args' => [],
+ 'args' => [Mockery::mock(L10n::class)],
],
'legacy' => [
'assert' => LegacyModule::class,
'name' => 'display',
'command' => 'display/test/it',
'privAdd' => false,
- 'args' => [__DIR__ . '/../../datasets/legacy/legacy.php'],
+ 'args' => [Mockery::mock(L10n::class), __DIR__ . '/../../datasets/legacy/legacy.php'],
],
'new' => [
'assert' => HostMeta::class,
'not_required',
'command' => '.well-known/host-meta',
'privAdd' => false,
- 'args' => [],
+ 'args' => [Mockery::mock(L10n::class)],
],
'404' => [
'assert' => PageNotFound::class,
'name' => 'invalid',
'command' => 'invalid',
'privAdd' => false,
- 'args' => [],
+ 'args' => [Mockery::mock(L10n::class)],
]
];
}
</notes>
XML;
- $notification = new Notification(['extension' => 'xml']);
+ $notification = new Notification(DI::l10n(), ['extension' => 'xml']);
$notification->rawContent();
self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput());
public function testWithJsonResult()
{
- $notification = new Notification(['parameter' => 'json']);
+ $notification = new Notification(DI::l10n(),['parameter' => 'json']);
$notification->rawContent();
$result = json_encode(ApiResponseDouble::getOutput());
namespace Friendica\Test\src\Module\Api\Friendica\Photo;
+use Friendica\DI;
use Friendica\Module\Api\Friendica\Photo\Delete;
use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest;
public function testEmpty()
{
$this->expectException(BadRequestException::class);
- (new Delete())->rawContent();
+ (new Delete(DI::l10n()))->rawContent();
}
public function testWithoutAuthenticatedUser()
public function testWrong()
{
$this->expectException(BadRequestException::class);
- (new Delete(['photo_id' => 1]))->rawContent();
+ (new Delete(DI::l10n(), ['photo_id' => 1]))->rawContent();
}
public function testWithCorrectPhotoId()
namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
+use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Delete;
use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest;
public function testEmpty()
{
$this->expectException(BadRequestException::class);
- (new Delete())->rawContent();
+ (new Delete(DI::l10n()))->rawContent();
}
public function testWrong()
{
$this->expectException(BadRequestException::class);
- (new Delete(['album' => 'album_name']))->rawContent();
+ (new Delete(DI::l10n(), ['album' => 'album_name']))->rawContent();
}
public function testValid()
namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
+use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Update;
use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest;
public function testEmpty()
{
$this->expectException(BadRequestException::class);
- (new Update())->rawContent();
+ (new Update(DI::l10n()))->rawContent();
}
public function testTooFewArgs()
{
$this->expectException(BadRequestException::class);
- (new Update(['album' => 'album_name']))->rawContent();
+ (new Update(DI::l10n(), ['album' => 'album_name']))->rawContent();
}
public function testWrongUpdate()
{
$this->expectException(BadRequestException::class);
- (new Update(['album' => 'album_name', 'album_new' => 'album_name']))->rawContent();
+ (new Update(DI::l10n(), ['album' => 'album_name', 'album_new' => 'album_name']))->rawContent();
}
public function testWithoutAuthenticatedUser()
namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial;
+use Friendica\DI;
use Friendica\Module\Api\GNUSocial\GNUSocial\Version;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
{
public function test()
{
- $version = new Version(['extension' => 'json']);
+ $version = new Version(DI::l10n(), ['extension' => 'json']);
$version->rawContent();
$result = json_decode(ApiResponseDouble::getOutput());
namespace Friendica\Test\src\Module\Api\GnuSocial\Help;
+use Friendica\DI;
use Friendica\Module\Api\GNUSocial\Help\Test;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
{
public function testJson()
{
- $test = new Test(['extension' => 'json']);
+ $test = new Test(DI::l10n(), ['extension' => 'json']);
$test->rawContent();
self::assertEquals('"ok"', ApiResponseDouble::getOutput());
public function testXml()
{
- $test = new Test(['extension' => 'xml']);
+ $test = new Test(DI::l10n(), ['extension' => 'xml']);
$test->rawContent();
self::assertxml(ApiResponseDouble::getOutput(), 'ok');
namespace Friendica\Test\src\Module\Api\Twitter\Account;
+use Friendica\DI;
use Friendica\Module\Api\Twitter\Account\RateLimitStatus;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
{
public function testWithJson()
{
- $rateLimitStatus = new RateLimitStatus(['extension' => 'json']);
+ $rateLimitStatus = new RateLimitStatus(DI::l10n(), ['extension' => 'json']);
$rateLimitStatus->rawContent();
$result = json_decode(ApiResponseDouble::getOutput());
public function testWithXml()
{
- $rateLimitStatus = new RateLimitStatus(['extension' => 'xml']);
+ $rateLimitStatus = new RateLimitStatus(DI::l10n(),['extension' => 'xml']);
$rateLimitStatus->rawContent();
self::assertXml(ApiResponseDouble::getOutput(), 'hash');
namespace Friendica\Test\src\Module\Api\Twitter;
+use Friendica\DI;
use Friendica\Module\Api\Twitter\SavedSearches;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
{
public function test()
{
- $savedSearch = new SavedSearches(['extension' => 'json']);
+ $savedSearch = new SavedSearches(DI::l10n(), ['extension' => 'json']);
$savedSearch->rawContent();
$result = json_decode(ApiResponseDouble::getOutput());