find('nelmio:apidoc:dump'); $commandTester = new CommandTester($command); $commandTester->execute([ '--area' => 'test', '--no-pretty' => '', ]); // the output of the command in the console $output = $commandTester->getDisplay(); $this->assertEquals(json_encode($this->getOpenApiDefinition('test'))."\n", $output); } }