mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Revert "Revert "Replace Module::init() with Constructors""
This reverts commit 89d6c89b67
.
This commit is contained in:
parent
942001b04d
commit
645e4edc63
43 changed files with 1226 additions and 922 deletions
|
@ -67,7 +67,7 @@ class NotificationTest extends ApiTest
|
|||
</notes>
|
||||
XML;
|
||||
|
||||
$notification = new Notification(['extension' => 'xml']);
|
||||
$notification = new Notification(DI::l10n(), ['extension' => 'xml']);
|
||||
$notification->rawContent();
|
||||
|
||||
self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput());
|
||||
|
@ -75,7 +75,7 @@ XML;
|
|||
|
||||
public function testWithJsonResult()
|
||||
{
|
||||
$notification = new Notification(['parameter' => 'json']);
|
||||
$notification = new Notification(DI::l10n(),['parameter' => 'json']);
|
||||
$notification->rawContent();
|
||||
|
||||
$result = json_encode(ApiResponseDouble::getOutput());
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
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;
|
||||
|
@ -30,7 +31,7 @@ class DeleteTest extends ApiTest
|
|||
public function testEmpty()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
(new Delete())->rawContent();
|
||||
(new Delete(DI::l10n()))->rawContent();
|
||||
}
|
||||
|
||||
public function testWithoutAuthenticatedUser()
|
||||
|
@ -41,7 +42,7 @@ class DeleteTest extends ApiTest
|
|||
public function testWrong()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
(new Delete(['photo_id' => 1]))->rawContent();
|
||||
(new Delete(DI::l10n(), ['photo_id' => 1]))->rawContent();
|
||||
}
|
||||
|
||||
public function testWithCorrectPhotoId()
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
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;
|
||||
|
@ -30,13 +31,13 @@ class DeleteTest extends 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()
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
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;
|
||||
|
@ -30,19 +31,19 @@ class UpdateTest extends 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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue