Skip to content

Commit

Permalink
Update CGL
Browse files Browse the repository at this point in the history
  • Loading branch information
sfroemkenjw committed Jan 8, 2025
1 parent 61dbcaa commit 159a7a6
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Classes/Client/AvalexClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
public function __construct(
private MessageHelper $messageHelper,
private RequestFactory $requestFactory
private RequestFactory $requestFactory,
) {}

public function processRequest(RequestInterface $request): ResponseInterface
Expand Down
2 changes: 1 addition & 1 deletion Classes/Client/Request/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private readonly AvalexConfigurationRepository $avalexConfigurationRepository,
private LanguageService $languageService,
private readonly LoggerInterface $logger,
iterable $registeredAvalexRequests
iterable $registeredAvalexRequests,
) {
$this->registeredAvalexRequests = $registeredAvalexRequests;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getHtmlContentFromEndpoint(
new PostProcessApiResponseContentEvent(
$content,
$endpointRequest,
$this->getContentObjectRendererFromRequest($request)
$this->getContentObjectRendererFromRequest($request),
),
);

Expand Down
3 changes: 1 addition & 2 deletions Tests/Functional/AvalexPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use JWeiland\Avalex\AvalexPlugin;
use JWeiland\Avalex\Client\Request\Endpoint\ImpressumRequest;
use JWeiland\Avalex\Client\Request\RequestFactory;
use JWeiland\Avalex\Domain\Model\AvalexConfiguration;
use JWeiland\Avalex\Service\ApiService;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\MockObject\MockObject;
Expand Down Expand Up @@ -112,7 +111,7 @@ public function renderWillReturnContent(): void
->method('getHtmlContentFromEndpoint')
->with(
self::isInstanceOf(ImpressumRequest::class),
self::isInstanceOf(ServerRequestInterface::class)
self::isInstanceOf(ServerRequestInterface::class),
)
->willReturn('Hello World!');

Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/Client/AvalexClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function processRequestWithInvalidRequestWillAddFlashMessage(): void
->with(
self::stringStartsWith('URI is empty or contains invalid chars'),
self::identicalTo('Invalid request URI'),
self::equalTo(ContextualFeedbackSeverity::ERROR)
self::equalTo(ContextualFeedbackSeverity::ERROR),
);

$impressumRequest = new ImpressumRequest();
Expand All @@ -96,7 +96,7 @@ public function processRequestWithEmptyResponseWillReturnEmptyAvalexResponse():
->with(
self::stringStartsWith('The response of Avalex was empty.'),
self::identicalTo('Empty Avalex response'),
self::equalTo(ContextualFeedbackSeverity::ERROR)
self::equalTo(ContextualFeedbackSeverity::ERROR),
);

$impressumRequest = new ImpressumRequest();
Expand Down Expand Up @@ -148,7 +148,7 @@ public function processRequestWithHttpErrorWillReturnEmptyAvalexResponse(): void
->with(
self::stringStartsWith('Error somewhere at avalex servers'),
self::identicalTo('Avalex Response Error'),
self::equalTo(ContextualFeedbackSeverity::ERROR)
self::equalTo(ContextualFeedbackSeverity::ERROR),
);

$impressumRequest = new ImpressumRequest();
Expand Down
7 changes: 3 additions & 4 deletions Tests/Functional/Client/Request/RequestFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace JWeiland\Avalex\Tests\Functional\Client\Request;

use JWeiland\Avalex\AvalexPlugin;
use JWeiland\Avalex\Client\Request\Endpoint\BedingungenRequest;
use JWeiland\Avalex\Client\Request\Endpoint\DatenschutzerklaerungRequest;
use JWeiland\Avalex\Client\Request\Endpoint\ImpressumRequest;
Expand Down Expand Up @@ -97,7 +96,7 @@ public function createWithNoAvalexConfigurationWillReturnErrorMessage(): void
->willReturn(null);

self::assertNull(
$this->subject->create('', $this->request)
$this->subject->create('', $this->request),
);
}

Expand All @@ -121,7 +120,7 @@ public function createWithNonRegisteredEndpointWillLogError(): void
));

self::assertNull(
$this->subject->create('foo', $this->request)
$this->subject->create('foo', $this->request),
);
}

Expand Down Expand Up @@ -152,7 +151,7 @@ public function createWillReturnEndpointRequests(string $endpoint, string $expec

self::assertInstanceOf(
$expectedClass,
$this->subject->create($endpoint, $this->request)
$this->subject->create($endpoint, $this->request),
);
}
}
20 changes: 10 additions & 10 deletions Tests/Functional/Client/Response/AvalexResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getBodyReturnsEmptyString(): void
'Content-Length' => '123',
],
200,
false
false,
);

self::assertSame(
Expand All @@ -54,7 +54,7 @@ public function getBodyReturnsContentAsString(): void
'Content-Length' => '123',
],
200,
false
false,
);

self::assertSame(
Expand All @@ -73,7 +73,7 @@ public function getBodyReturnsContentAsArray(): void
'Content-Length' => '123',
],
200,
true
true,
);

self::assertSame(
Expand All @@ -91,7 +91,7 @@ public function getHeadersReturnsEmptyArray(): void
'test123',
[],
200,
false
false,
);

self::assertSame(
Expand All @@ -107,7 +107,7 @@ public function getHeadersWithStringReturnsArray(): void
'test123',
'Expires: 0' . CRLF . 'Content-Length: 123',
200,
false
false,
);

self::assertSame(
Expand All @@ -133,7 +133,7 @@ public function getHeadersWithSimpleArrayReturnsArray(): void
'Content-Length' => '123',
],
200,
false
false,
);

self::assertSame(
Expand Down Expand Up @@ -181,7 +181,7 @@ public function getStatusCodeReturnsInitially200(): void
'Content-Length' => '123',
],
200,
false
false,
);

self::assertSame(
Expand All @@ -200,7 +200,7 @@ public function getStatusCodeReturns401(): void
'Content-Length' => '123',
],
401,
false
false,
);

self::assertSame(
Expand All @@ -219,7 +219,7 @@ public function isJsonResponseInitiallyReturnsFalse(): void
'Content-Length' => '123',
],
200,
false
false,
);

self::assertFalse(
Expand All @@ -237,7 +237,7 @@ public function setJsonResponseSetsJsonResponse(): void
'Content-Length' => '123',
],
200,
true
true,
);

self::assertTrue(
Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/Service/ApiServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getHtmlContentFromEndpointWillReturnContentFromCache(): void

self::assertSame(
'Hello World!',
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request)
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request),
);
}

Expand All @@ -121,7 +121,7 @@ public function getHtmlContentFromEndpointWithEmptyContentWillNotCacheContent():

self::assertSame(
'',
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request)
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request),
);
}

Expand Down Expand Up @@ -152,7 +152,7 @@ public function getHtmlContentFromEndpointWillCacheAndReturnContent(): void

self::assertSame(
'Hello World!',
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request)
$this->subject->getHtmlContentFromEndpoint(new ImpressumRequest(), $this->request),
);
}
}

0 comments on commit 159a7a6

Please sign in to comment.