Improve tests

This commit is contained in:
Anton Medvedev 2021-10-11 22:03:43 +02:00
parent ff06e8a26a
commit 90db1c16d2

View File

@ -9,6 +9,7 @@ namespace Deployer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Tester\ApplicationTester;
abstract class AbstractTest extends TestCase
@ -52,4 +53,18 @@ abstract class AbstractTest extends TestCase
$this->deployer->init();
$this->deployer->config->set('deploy_path', __TEMP_DIR__ . '/{{hostname}}');
}
protected function dep(string $recipe, string $task)
{
$this->init($recipe);
$this->tester->run([
$task,
'selector' => 'all',
'-f' => $recipe,
'-l' => 1
], [
'verbosity' => Output::VERBOSITY_VERBOSE,
'interactive' => false,
]);
}
}