Convert variable "rules" to array (#507)

* convert variable "rules" to array

* allow importing eggs with string rules

* fix tests

* update stock eggs to rules array
This commit is contained in:
Boy132
2024-08-19 08:33:53 +02:00
committed by GitHub
parent 0ff429215d
commit c2b1a98d29
25 changed files with 408 additions and 118 deletions

View File

@@ -120,7 +120,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase
[$user, $server] = $this->generateTestAccount();
$egg = $this->cloneEggAndVariables($server->egg);
$egg->variables()->first()->update(['rules' => 'nullable|string']);
$egg->variables()->first()->update(['rules' => ['nullable', 'string']]);
$server->fill(['egg_id' => $egg->id])->save();
$server->refresh();

View File

@@ -120,7 +120,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase
$egg = $this->cloneEggAndVariables($this->egg);
$egg->variables()->where('env_variable', '!=', 'BUNGEE_VERSION')->delete();
$egg->variables()->update(['rules' => 'nullable|string']);
$egg->variables()->update(['rules' => ['nullable', 'string']]);
$response = $this->getService()->handle($egg->id, []);
$this->assertCount(1, $response);