mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 00:47:13 +02:00
3
system/recovery.flag
Normal file
3
system/recovery.flag
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"token": "2d1aaf07ea67021fa3adb08ac80cf0a4"
|
||||
}
|
||||
@@ -8,19 +8,23 @@ class RecoveryManagerTest extends \PHPUnit\Framework\TestCase
|
||||
/** @var string */
|
||||
private $tmpDir;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->tmpDir = sys_get_temp_dir() . '/grav-recovery-' . uniqid('', true);
|
||||
Folder::create($this->tmpDir);
|
||||
Folder::create($this->tmpDir . '/user');
|
||||
Folder::create($this->tmpDir . '/system');
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (is_dir($this->tmpDir)) {
|
||||
Folder::delete($this->tmpDir);
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testHandleShutdownQuarantinesPluginAndCreatesFlag(): void
|
||||
|
||||
@@ -8,17 +8,21 @@ class SafeUpgradeServiceTest extends \PHPUnit\Framework\TestCase
|
||||
/** @var string */
|
||||
private $tmpDir;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->tmpDir = sys_get_temp_dir() . '/grav-safe-upgrade-' . uniqid('', true);
|
||||
Folder::create($this->tmpDir);
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (is_dir($this->tmpDir)) {
|
||||
Folder::delete($this->tmpDir);
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testPreflightAggregatesWarnings(): void
|
||||
|
||||
@@ -5,6 +5,7 @@ use Grav\Common\Upgrade\SafeUpgradeService;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class RollbackCommandTest extends \PHPUnit\Framework\TestCase
|
||||
@@ -233,7 +234,7 @@ class RollbackMemoryStyle extends SymfonyStyle
|
||||
parent::success($message);
|
||||
}
|
||||
|
||||
public function askQuestion($question)
|
||||
public function askQuestion(Question $question): mixed
|
||||
{
|
||||
if ($this->responses) {
|
||||
return array_shift($this->responses);
|
||||
|
||||
@@ -5,6 +5,7 @@ use Grav\Console\Gpm\SelfupgradeCommand;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class SelfupgradeCommandTest extends \PHPUnit\Framework\TestCase
|
||||
@@ -193,7 +194,7 @@ class SelfUpgradeMemoryStyle extends SymfonyStyle
|
||||
parent::writeln($messages, $type);
|
||||
}
|
||||
|
||||
public function askQuestion($question)
|
||||
public function askQuestion(Question $question): mixed
|
||||
{
|
||||
if ($this->responses) {
|
||||
return array_shift($this->responses);
|
||||
@@ -202,12 +203,12 @@ class SelfUpgradeMemoryStyle extends SymfonyStyle
|
||||
return parent::askQuestion($question);
|
||||
}
|
||||
|
||||
public function choice($question, array $choices, $default = null, $attempts = null, $errorMessage = 'Invalid value.')
|
||||
public function choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed
|
||||
{
|
||||
if ($this->responses) {
|
||||
return array_shift($this->responses);
|
||||
}
|
||||
|
||||
return parent::choice($question, $choices, $default, $attempts, $errorMessage);
|
||||
return parent::choice($question, $choices, $default, $multiSelect);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user