Update DockerTest.php

This commit is contained in:
Bozhidar 2024-04-30 01:10:08 +03:00
parent ac3abe3e94
commit e7cec4c7c5

View file

@ -2,6 +2,7 @@
namespace tests\Unit; namespace tests\Unit;
use App\Filament\Pages\Modules;
use App\Models\User; use App\Models\User;
use Filament\Actions\DeleteAction; use Filament\Actions\DeleteAction;
use Livewire\Livewire; use Livewire\Livewire;
@ -20,13 +21,14 @@ class DockerTest extends TestCase
ini_set('memory_limit', '-1'); ini_set('memory_limit', '-1');
ini_set('max_execution_time', 0); ini_set('max_execution_time', 0);
$docker = new PostInstall(); $modulesTest = Livewire::test(Modules::class);
$docker->setLogFile('/tmp/phyrepanel-docker-install.log'); $modulesTest->call('openInstallModal', 'Docker');
$docker->run();
$installLogFilePath = $modulesTest->get('installLogFilePath');
$dockerIsInstalled = false; $dockerIsInstalled = false;
for ($i = 0; $i < 50; $i++) { for ($i = 0; $i < 50; $i++) {
$logFile = file_get_contents('/tmp/phyrepanel-docker-install.log'); $logFile = file_get_contents($installLogFilePath);
if (strpos($logFile, 'Done!') !== false) { if (strpos($logFile, 'Done!') !== false) {
$dockerIsInstalled = true; $dockerIsInstalled = true;
break; break;