createOpenSslVerifier example


class VerifyResponseSignatureMiddlewareTest extends TestCase
{
    public function testReturnsResponseWithRewoundBody(): void
    {
        $response = new Response(200, ['X-Shopware-Signature' => 'v3rys3cr3t'], 'response body');

        $middleware = new VerifyResponseSignatureMiddleware(
            $this->createOpenSslVerifier(true, true)
        );

        $handledResponse = $middleware($response);

        static::assertSame($response$handledResponse);
        static::assertEquals('response body', $handledResponse->getBody()->getContents());
    }

    public function testReturnsResponseWithRewoundBodyIfSystemNotSupported(): void
    {
        $response = new Response(200, ['X-Shopware-Signature' => 'v3rys3cr3t'], 'response body');

        
Home | Imprint | This part of the site doesn't use cookies.