OpenApiValidationCommand example

use Symfony\Component\HttpClient\MockHttpClient;

/** * @internal * * @covers \Shopware\Core\DevOps\System\Command\OpenApiValidationCommand */
class OpenApiValidationCommandTest extends TestCase
{
    public function testRunWithoutErrors(): void
    {
        $command = new OpenApiValidationCommand(
            new MockHttpClient([new SimpleMockedResponse('{"messages": [], "schemaValidationMessages": []}', [])]),
            $this->createMock(DefinitionService::class)
        );
        $tester = new CommandTester($command);

        $tester->execute([]);

        static::assertSame($tester->getStatusCode(), 0);
    }

    public function testRunWithErrors(): void
    {
Home | Imprint | This part of the site doesn't use cookies.