Could the factory return an instance instead of array? #15
Replies: 3 comments
-
@shawnlindstrom I have a very similar situation. Were you able to find a way around this for now? |
Beta Was this translation helpful? Give feedback.
-
@lukeraymonddowning got any ideas or alternative solutions for this problem? 👀 |
Beta Was this translation helpful? Give feedback.
-
@JeffreyDavidson @olivernybroe See my original post. You can take the array provided by the factory and create your own instance:
Honestly, I think doing it this way is fine. I've only ever needed it once and I think if I looked closer I could probably remove the eliminate the need for it altogether. |
Beta Was this translation helpful? Give feedback.
-
I have a trait I want to test directly in a unit test that is type hinted as SomethingStoreRequest. Since the request factory returns an array, I get a type mismatch error. It would be cool to have a (clean) way to get an instance of the request other than making an actual request?
For example:
Instead of:
This is probably in the weeds a bit, but since it came up for me I thought I'd put it out there.
Beta Was this translation helpful? Give feedback.
All reactions