backupscript/tests/CommandBackupTest.php
Jens True f41571cfd2
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
More tests and refactoring
2023-06-15 14:10:17 +00:00

24 lines
655 B
PHP

<?php
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use App\CommandBackup;
class CommandBackupTest extends \PHPUnit\Framework\TestCase
{
public function testInvalidConfig()
{
$applicationd = new Application('backup', "1.1.1");
$applicationd->add(new CommandBackup());
$command = $applicationd->find('backup');
$commandTester = new CommandTester($command);
$commandTester->execute(['config'=>"empty"]);
$output = $commandTester->getDisplay();
$this->assertStringContainsString('backup', $output);
}
}