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
Soft Delete interferes with PHPUnit Testing #135
Comments
Thats normal if u add the behavior |
Not sure what you mean? I do have fixtures included, and they work without the behavior. |
Did you also add the device fixture as the error warns about? |
Yes, as I said if I uncomment the SoftDelete behavior, it works as expected. |
I rather see a mistake in your model or fixture setup. Shoudnt device be plural devices? |
Here's a simplified copy of the model and fixture code. https://gist.github.com/NickBusey/4b309eb0c066fa8cd805 With actsAs SoftDelete it fails with a Missing Database Table error. Comment out actsAs SoftDelete and it works. |
I still suspect the inflection to be the root cause of the issue here. Did you try using the conventions "devices" name approach here for the table name? |
I changed 'device' to 'devices'. The web end works fine. Running the test, get the same error pointing now at 'devices'.
|
I'm going to assume this is an unknown issue with an unknown timeframe for a fix. I'm going to try and start debugging it. Any ideas or suggestions on where to look first would be appreciated. |
Commenting out Line 239 of SoftDeleteBehavior.php seems to fix the issue with the tests. The behavior functionality seems to work without this line: $this->_softDeleteAssociations($model, $active); |
SoftDelete is deprecated and only 2.x needs fixing if someone is filling to provide a PR. |
Closing until PR is open. |
Running my tests, I get the following error:
If I comment out the actsAs => SoftDelete line, it works fine.
Any ideas? Thanks much for all your work.
The text was updated successfully, but these errors were encountered: