Adapt API tests for dynamic usage
This commit is contained in:
@@ -67,14 +67,16 @@ class NotificationTest extends ApiTest
|
||||
</notes>
|
||||
XML;
|
||||
|
||||
Notification::rawContent(['extension' => 'xml']);
|
||||
$notification = new Notification(['extension' => 'xml']);
|
||||
$notification->rawContent();
|
||||
|
||||
self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput());
|
||||
}
|
||||
|
||||
public function testWithJsonResult()
|
||||
{
|
||||
Notification::rawContent(['parameter' => 'json']);
|
||||
$notification = new Notification(['parameter' => 'json']);
|
||||
$notification->rawContent();
|
||||
|
||||
$result = json_encode(ApiResponseDouble::getOutput());
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class DeleteTest extends ApiTest
|
||||
public function testEmpty()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Delete::rawContent();
|
||||
(new Delete())->rawContent();
|
||||
}
|
||||
|
||||
public function testWithoutAuthenticatedUser()
|
||||
@@ -41,7 +41,7 @@ class DeleteTest extends ApiTest
|
||||
public function testWrong()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Delete::rawContent(['photo_id' => 1]);
|
||||
(new Delete(['photo_id' => 1]))->rawContent();
|
||||
}
|
||||
|
||||
public function testWithCorrectPhotoId()
|
||||
|
||||
@@ -30,13 +30,13 @@ class DeleteTest extends ApiTest
|
||||
public function testEmpty()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Delete::rawContent();
|
||||
(new Delete())->rawContent();
|
||||
}
|
||||
|
||||
public function testWrong()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Delete::rawContent(['album' => 'album_name']);
|
||||
(new Delete(['album' => 'album_name']))->rawContent();
|
||||
}
|
||||
|
||||
public function testValid()
|
||||
|
||||
@@ -30,19 +30,19 @@ class UpdateTest extends ApiTest
|
||||
public function testEmpty()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Update::rawContent();
|
||||
(new Update())->rawContent();
|
||||
}
|
||||
|
||||
public function testTooFewArgs()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Update::rawContent(['album' => 'album_name']);
|
||||
(new Update(['album' => 'album_name']))->rawContent();
|
||||
}
|
||||
|
||||
public function testWrongUpdate()
|
||||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
Update::rawContent(['album' => 'album_name', 'album_new' => 'album_name']);
|
||||
(new Update(['album' => 'album_name', 'album_new' => 'album_name']))->rawContent();
|
||||
}
|
||||
|
||||
public function testWithoutAuthenticatedUser()
|
||||
|
||||
Reference in New Issue
Block a user