-
Notifications
You must be signed in to change notification settings - Fork 93
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
Hydrating a Resource node object doesn't transfer client instance from Recurly_Pager #254
Comments
Interesting... so seems like Do you have any test code you were using that demonstrates the problem that I could use to build a unit test off of? |
I can do one better than that! Here's a full unit test demonstrating the problem and a patch that solves it. You'll see when this test runs that we get the error |
Any updates/thoughts on this? |
hey sorry! i want to get this into the next release. would you be offended if i redo that spec? |
Are you referring to the unit test I wrote? Yeah, do whatever you want with it - it's just for demonstrating the issue. |
During a singular resource hydration
Recurly_Base::__parseResponseToNewObject()
is called, which passes the client instance to the newly created resource object. However, when aRecurly_Pager
subclass likeRecurly_SubscriptionList
hydrates all of its nodes and callsRecurly_Base::__createNodeObject()
, that method does NOT pass the client instance to the each newly created resource objects. This means if a subclassed or mockedRecurly_Client
class is used as the client inRecurly_SubscriptionList
, the resulting node objects cannot be used directly with the same expected client behavior.The text was updated successfully, but these errors were encountered: