Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Change Laravel Permission config to avoid to log alert while running tests #27

Merged

Conversation

kslimani
Copy link
Contributor

A simple fix to avoid Laravel log file to be filled with "Could not register permissions..." alert messages.

This is because for each test, an application instance is created before running use trait tasks (database migration, etc...). Each time application instance is created, the Spatie laravel-permission service provider attempt to register permissions. (and since database is not migrated yet, it fail and write an exception message in log file).

To avoid this behaviour, the laravel-permission provide the log_registration_exception boolean option : theses changes simply set this option to false if APP_ENV equals "testing".

@joselfonseca joselfonseca merged commit 76f1649 into joselfonseca:master Aug 25, 2017
@joselfonseca
Copy link
Owner

Thank you!

@kslimani kslimani deleted the fix-test-permissions-cache branch August 25, 2017 10:32
@joselfonseca joselfonseca added this to the 3.2.0 milestone Aug 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants