Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit Testing / Initialize Settings #51

Open
muhzak opened this issue Jul 24, 2024 · 1 comment
Open

PHPUnit Testing / Initialize Settings #51

muhzak opened this issue Jul 24, 2024 · 1 comment

Comments

@muhzak
Copy link

muhzak commented Jul 24, 2024

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.

@muhzak
Copy link
Author

muhzak commented Jul 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant