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
Cannot bake ControllerTest with model type other than Table #951
Comments
Side note:
those are both protected ones |
I couldnt reproduce this with Admin routes inside app:
The controller contained the two lines
|
Source of this bug is the fact that baking test for Controller also triggers fixture baking logic. protected function _processModel(Table $subject): void So when $subject takes value of Solution would be to change it to: protected function _processModel(RepositoryInterface $subject): void
if (!method_exists($subject, 'associations')) {
return;
} |
Please notice that when |
@asgraf A patch would be welcome to resolve the issue. Though instead of using a method_exists() check as you suggested, checking whether the subject is an instance of |
Support for non-table model types
Usage of |
To date I haven't come across any implementation of non db repository which has associations. Also the code assumes the association classes are the database specific ones used in the core ORM. It's highly unlikely the code will work with any other user implemented association classes. |
Feel free to modify my pull requests |
This issue is stale because it has been open for 120 days with no activity. Remove the |
Description
Steps to reproduce:
CakePHP Version
4.4.17
PHP Version
8.1
The text was updated successfully, but these errors were encountered: