Fix errors for some devices loading components (#11527)

* Test WIP

* WIP

* port getComponents to Eloquent

* port more

* simpler creation

* change to explicit arrays

* add missed file

* restore commented code

* fix inserting null value for component prefs

* Fix some bugs in setCompenentPrefs
Can't create tests without fixing bugs first :D

* another test

* another test

* Modernize setComponentPrefs

* Test for event log entries

* Fix delete event

* fix invalid values for component toggles

* status log too

* Use Setters to work around bad data, $casts doesn't do what we want.
This commit is contained in:
Tony Murray
2020-05-08 00:30:56 -05:00
committed by GitHub
parent 305ccf20aa
commit 73ac93d729
7 changed files with 387 additions and 207 deletions

View File

@@ -131,3 +131,10 @@ $factory->define(\App\Models\Vminfo::class, function (Faker\Generator $faker) {
'vmwVmState' => $faker->randomElement(['powered on', 'powered off', 'suspended']),
];
});
$factory->define(\App\Models\Component::class, function (Faker\Generator $faker) {
return [
'device_id' => $faker->randomDigit,
'type' => $faker->regexify('[A-Za-z0-9]{4,20}'),
];
});