Add feedback - avoid intermediate variables

This commit is contained in:
Philipp 2022-01-02 01:04:04 +01:00
parent adf0d7bc95
commit 301ac83ebf
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
42 changed files with 367 additions and 272 deletions

View file

@ -20,8 +20,8 @@ class CreateTest extends ApiTest
{
$this->expectException(BadRequestException::class);
$create = new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]);
$create->run();
(new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))
->run();
}
/**
@ -31,8 +31,10 @@ class CreateTest extends ApiTest
*/
public function testApiFavoritesCreateDestroyWithCreateAction()
{
$create = new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]);
$response = $create->run(['id' => 3]);
$response = (new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))
->run([
'id' => 3
]);
$json = $this->toJson($response);
@ -46,8 +48,10 @@ class CreateTest extends ApiTest
*/
public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
{
$create = new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST], ['extension' => ICanCreateResponses::TYPE_RSS]);
$response = $create->run(['id' => 3]);
$response = (new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST], ['extension' => ICanCreateResponses::TYPE_RSS]))
->run([
'id' => 3
]);
self::assertEquals(ICanCreateResponses::TYPE_RSS, $response->getHeaderLine(ICanCreateResponses::X_HEADER));