vito/tests/Feature/SSHCommands/PHPMyAdmin/DeleteNginxPHPMyAdminVHostCommandTest.php
Saeed Vaziry e1eb42059f code style fix
add command tests
2023-09-02 16:41:42 +02:00

31 lines
753 B
PHP

<?php
namespace Tests\Feature\SSHCommands\PHPMyAdmin;
use App\SSHCommands\PHPMyAdmin\DeleteNginxPHPMyAdminVHostCommand;
use Tests\TestCase;
class DeleteNginxPHPMyAdminVHostCommandTest extends TestCase
{
public function test_generate_command()
{
$command = new DeleteNginxPHPMyAdminVHostCommand('/home/vito/phpmyadmin');
$expected = <<<'EOD'
sudo rm -rf /home/vito/phpmyadmin
sudo rm /etc/nginx/sites-available/phpmyadmin
sudo rm /etc/nginx/sites-enabled/phpmyadmin
if ! sudo service nginx restart; then
echo 'VITO_SSH_ERROR' && exit 1
fi
echo "PHPMyAdmin deleted"
EOD;
$this->assertStringContainsString($expected, $command->content());
}
}