mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 10:21:37 +00:00
31 lines
663 B
PHP
31 lines
663 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\SSHCommands\PHP;
|
|
|
|
use App\SSHCommands\PHP\ChangeDefaultPHPCommand;
|
|
use Tests\TestCase;
|
|
|
|
class ChangeDefaultPHPCommandTest extends TestCase
|
|
{
|
|
public function test_generate_command()
|
|
{
|
|
$command = new ChangeDefaultPHPCommand('8.2');
|
|
|
|
$expected = <<<'EOD'
|
|
if ! sudo rm /usr/bin/php; then
|
|
echo 'VITO_SSH_ERROR' && exit 1
|
|
fi
|
|
|
|
if ! sudo ln -s /usr/bin/php8.2 /usr/bin/php; then
|
|
echo 'VITO_SSH_ERROR' && exit 1
|
|
fi
|
|
|
|
echo "Default php is: "
|
|
|
|
php -v
|
|
EOD;
|
|
|
|
$this->assertStringContainsString($expected, $command->content());
|
|
}
|
|
}
|