validateRequestSchema example

$this->appendNewResponse(new Response(200));
        $this->executor->execute($action, Context::createDefaultContext());

        /** @var Request $request */
        $request = $this->getLastRequest();

        static::assertEquals('POST', $request->getMethod());
        $body = $request->getBody()->getContents();
        static::assertJson($body);

        $result = $this->validateRequestSchema($body);

        $message = $this->parseSchemaErrors($result);

        static::assertTrue($result->isValid()$message);

        $appSecret = $action->getAppSecret();
        static::assertNotNull($appSecret);

        static::assertEquals(
            hash_hmac('sha256', $body$appSecret),
            $request->getHeaderLine('shopware-shop-signature')
        );
Home | Imprint | This part of the site doesn't use cookies.