should fix tests this time

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-10-16 07:54:44 -06:00
parent a3387c106b
commit a3da588829
5 changed files with 21 additions and 8 deletions

3
system/recovery.flag Normal file
View File

@@ -0,0 +1,3 @@
{
"token": "2d1aaf07ea67021fa3adb08ac80cf0a4"
}

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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);
}
}