You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to fakes, but I think I am understanding them albeit slowly.
To me they feel a little too fake - for lack of a better word.
Instead of:
$this->assertEquals(9750, $this->paymentGateway->totalCharges());
Which then has to have code irrelevant to the rest of your app (storing the charges as an array and then summing them)
Why not use a mock on the real StripeGateway and just verify that "charge" was called with parameter 9750?
Any shedding of light on this situation (when to use a fake or a mock) would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Hey Adam! I'm going try go make time tonight to answer this in more detail, but in the mean time here's a blog post I wrote a while back that goes into some of the benefits of fakes vs. mocks:
I am new to fakes, but I think I am understanding them albeit slowly.
To me they feel a little too fake - for lack of a better word.
Instead of:
$this->assertEquals(9750, $this->paymentGateway->totalCharges());
Which then has to have code irrelevant to the rest of your app (storing the charges as an array and then summing them)
Why not use a mock on the real StripeGateway and just verify that "charge" was called with parameter 9750?
Any shedding of light on this situation (when to use a fake or a mock) would be greatly appreciated.
The text was updated successfully, but these errors were encountered: