|
|
|
|
|
by wanderr
4641 days ago
|
|
Hmm, how so? In general it seems to make testing things easier since nothing is carrying around state; a static method with the same parameters is going to run exactly the same way every time no matter where or when it's called. |
|
Properly mocking methods allows you to get rid of this unknown and say, "The submit() method will return an array of this specified data" without Authorize.net ever getting a ping.
With static properties, the problem is that they do have memory. If you change it in one place in your codebase, that static property will then be changed across your whole codebase for that execution, even if you have multiple, separate object instances.