backupscript/tests/CommandBackupTest.php
2023-06-15 10:56:05 +00:00

26 lines
677 B
PHP

<?php
namespace App\Tests;
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);
}
}