Fixed tests
This commit is contained in:
parent
edffe0ef80
commit
2691894b78
|
@ -1,10 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Form\Models\Form;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
{
|
{
|
||||||
|
@ -18,7 +16,9 @@ return new class extends Migration
|
||||||
foreach (DB::table('forms')->get() as $event) {
|
foreach (DB::table('forms')->get() as $event) {
|
||||||
$config = json_decode($event->config);
|
$config = json_decode($event->config);
|
||||||
$config->sections = array_map(function ($section) {
|
$config->sections = array_map(function ($section) {
|
||||||
$section->fields = collect($section->fields)->map(function ($field) {
|
/** @var Collection<int, mixed> */
|
||||||
|
$fields = $section->fields;
|
||||||
|
$section->fields = collect($fields)->map(function ($field) {
|
||||||
if ($field->type === 'DropdownField' || $field->type === 'RadioField') {
|
if ($field->type === 'DropdownField' || $field->type === 'RadioField') {
|
||||||
$field->allowcustom = false;
|
$field->allowcustom = false;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,9 @@ return new class extends Migration
|
||||||
foreach (DB::table('formtemplates')->get() as $event) {
|
foreach (DB::table('formtemplates')->get() as $event) {
|
||||||
$config = json_decode($event->config);
|
$config = json_decode($event->config);
|
||||||
$config->sections = array_map(function ($section) {
|
$config->sections = array_map(function ($section) {
|
||||||
$section->fields = collect($section->fields)->map(function ($field) {
|
/** @var Collection<int, mixed> */
|
||||||
|
$fields = $section->fields;
|
||||||
|
$section->fields = collect($fields)->map(function ($field) {
|
||||||
if ($field->type === 'DropdownField' || $field->type === 'RadioField') {
|
if ($field->type === 'DropdownField' || $field->type === 'RadioField') {
|
||||||
$field->allowcustom = false;
|
$field->allowcustom = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue