-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug: Model doesn't reset errors in FeatureTestCase #3578
Comments
Are your tests using |
I don't use CodeIgniter4/system/CodeIgniter.php Line 409 in 8c90aa0
It's beacuse the variable CodeIgniter4/system/Router/Router.php Line 182 in 8c90aa0
If it's necessary I will create another issue. |
The Filters issue sounds like this (#3085) resolves July 7. Are you using the latest version of the code? |
I tried this solution but it doesn't work. it's apply after of function |
Okay, please open a new issue for the filters example, and this can track the validation issue. My guess is that you will need to reset Validation between tests - something we should probably be doing in the core. |
It's an example when models doesn't reset de errors. Test Class: Model Class: Controller Class: If it's necessary I upload more files. |
This is actually expected. /**
* Methods to run during setUp.
*
* @var array of methods
*/
protected $setUpMethods = [
'resetFactories',
'mockCache',
'mockEmail',
'mockSession',
]; If you desire this behavior there is already a |
Describe the bug
When I test with FeatureTestCase class the errors of models don't reset and I receive the last error.
Example:
Test PUT Method with bad validation. It return that I expect. But in the next test if I Test Put Method with success validation I still receive the last errors.
Example
CodeIgniter 4 version
latest.
Context
The text was updated successfully, but these errors were encountered: