for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\Foundry\Test;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
/**
* @internal
*/
abstract class AbstractSchemaResetter
{
abstract public function resetSchema(): void;
protected function runCommand(Application $application, string $command, array $parameters = []): void
$exit = $application->run(
new ArrayInput(\array_merge(['command' => $command], $parameters)),
$output = new BufferedOutput()
);
if (0 !== $exit) {
throw new \RuntimeException(\sprintf('Error running "%s": %s', $command, $output->fetch()));
}