Update DockerTest.php

This commit is contained in:
Bozhidar 2024-04-30 01:15:46 +03:00
parent 7fd6dfb6f2
commit 8d052a4121

View file

@ -3,6 +3,7 @@
namespace tests\Unit; namespace tests\Unit;
use App\Filament\Pages\Modules; use App\Filament\Pages\Modules;
use App\Models\Module;
use App\Models\User; use App\Models\User;
use Filament\Actions\DeleteAction; use Filament\Actions\DeleteAction;
use Livewire\Livewire; use Livewire\Livewire;
@ -27,7 +28,8 @@ class DockerTest extends TestCase
$installLogFilePath = $modulesTest->get('installLogFilePath'); $installLogFilePath = $modulesTest->get('installLogFilePath');
$dockerIsInstalled = false; $dockerIsInstalled = false;
for ($i = 0; $i < 50; $i++) { for ($i = 0; $i < 400; $i++) {
$modulesTest->call('getInstallLog');
$logFile = file_get_contents($installLogFilePath); $logFile = file_get_contents($installLogFilePath);
if (strpos($logFile, 'Done!') !== false) { if (strpos($logFile, 'Done!') !== false) {
$dockerIsInstalled = true; $dockerIsInstalled = true;
@ -37,6 +39,9 @@ class DockerTest extends TestCase
} }
$this->assertTrue($dockerIsInstalled); $this->assertTrue($dockerIsInstalled);
$findModule = Module::where('name', 'Docker')->first();
$this->assertNotEmpty($findModule);
$this->actingAs(User::factory()->create()); $this->actingAs(User::factory()->create());
$dockerImage = 'nginx'; $dockerImage = 'nginx';