Closed MilesHart closed 1 year ago
I have a data dependent testing, so I want to use a library of JSON files, what is the best way to load from a json file into a Fake model?
`$mockFileRaw = file_get_contents(DIR . "/../testdata/ruleMock1.json");
$objMock = json_decode($mockFileRaw);
Rule::fake();
$rule = Rule::create($objMock);`
Any help would be appreciated.
I am planning to add a feature for loading the initial data from config like php files. currently, you can loop through your data and use the FakeDB::addRow(...) method.
FakeDB::addRow(...)
Thank you, much appreciated.
I have a data dependent testing, so I want to use a library of JSON files, what is the best way to load from a json file into a Fake model?
`$mockFileRaw = file_get_contents(DIR . "/../testdata/ruleMock1.json");
$objMock = json_decode($mockFileRaw);
Rule::fake();
$rule = Rule::create($objMock);`
Any help would be appreciated.