I have just updated CFEasyMock to version 1.2.002 and the reflect package to 1.0.001 (cf7) and 2.1.002 (cf8) to fix a problem when using non-required arguments in function calls.
<cfargument name="param1" required="false" />
<cfargument name="param2" required="false" />
<cfargument name="param3" required="false" />
<cfset mockObj = mockFactory.createMock("MockObject") />
<cfset mockObj.aMethod(1, 2) />
Jack Ye noted that if you call this function with less than three parameters you will get an undefined error. The method invocation was not taking into consideration the required status of the argument.
With this fix, if you call the aMethod function with less than three parameters the mock will behave as expected. However, you mark an argument as required and do not pass it in, or do not pass in sufficient unnamed parameters to make sure the required positions are filled (not that I'd ever recommend coding that way!) then you will get an error, since required parameters should be passed.
For CF8 versions of CFEasyMock/reflect, the fix was applied to the onMissingMethod proxy mixin function.
For CF7 versions of CFEasyMock/reflect, the fix was applied to the ensureParameterNames method of the InvocationHandler. This method must be called in any extending component to correct the named vs. unnamed parameter function calls.