crud icon indicating copy to clipboard operation
crud copied to clipboard

Pass correct models to policy methods when listing resources

Open giant-robot opened this issue 2 years ago • 2 comments

Closes https://github.com/orchidsoftware/crud/issues/76

giant-robot avatar Aug 23 '22 14:08 giant-robot

Hi @giant-robot Can you please add a simple test for this?

tabuna avatar Aug 24 '22 18:08 tabuna

@tabuna I am seeing an issue with the test.

When the policy allows the user to access the list screen (viewAny returns true), the system attempts to fetch data from the roles table and PHPUnit subsequently fails because the table is not there.

I can't think of a way to test that the policy methods are indeed passed the right arguments without allowing access to the list screen and adding platform tables to the test environment seems like a deeper change than the scope of this PR.

How would you like to proceed?

giant-robot avatar Aug 25 '22 07:08 giant-robot