ColdBox/coldbox-platform — pull request #167 by ericpierce (2013-11-25 20:34:02+00:00)
Title: Preserve the method signature of a mocked method.  

The new functionality is to allow one to optionally preserve the method signature of a mocked method.

E.g., you are testing a method that has a call to a mocked method, but the call to the mocked method does not satisfy the mocked method's signature (the required params and their corresponding type). With my changes it will now throw your standard 'x parameter is required but not passed in' error.

// Here is an example of how you would mock your method to ensure any calls to the mocked method still abide by the method signature's contract.
myComponent.$( method = "someFunction", preserveMethodSignature=true ).$results( true );

// And here is how you would override the mocked method's signature (I.e., the way MockBox works now.)
myComponent.$( method = "someFunction", preserveMethodSignature=false ).$results( true );

I have preserveMethodSignature defaulted to true (in MockBox.cfc), so you could leave it off entirely in the first example above.