qcod/laravel-app-settings

PHPUnit Testing / Initialize Settings

muhzak opened this issue · 1 comments

During unit testing, if I load a fresh set of settings, it returns empty. How do I make sure it initializes to the default settings without having to save them one time? I don't want to depend on the cache.

I figured it out. I had to set data_type to boolean in addition to 'type' as boolean.

Also I noticed when you call settings()->all() or (new \QCod\AppSettings\Setting\AppSettings(settings())->all();

It gives you the database values instead of the cast values -- which should be the case for (new \QCod\AppSettings\Setting\AppSettings(settings()))->all();

unless I am mistaken.