Improvements to test.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2023-06-15 10:15:44 +00:00
parent 78c1ea0326
commit 3efa791d5e
7 changed files with 112 additions and 42 deletions

View File

@ -0,0 +1,29 @@
<?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 testExecute()
{
$applicationd = new Application('backup', "1.1.1");
$applicationd->add(new CommandBackup());
$command = $applicationd->find('backup');
$commandTester = new CommandTester($command);
$commandTester->execute([]);
$commandTester->assertCommandIsSuccessful();
// the output of the command in the console
$output = $commandTester->getDisplay();
$this->assertStringContainsString('backup', $output);
}
}