-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy path30942F4D0BCB6139072EF27C66218715.cfm
More file actions
70 lines (59 loc) · 2.65 KB
/
Copy path30942F4D0BCB6139072EF27C66218715.cfm
File metadata and controls
70 lines (59 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<cfscript>
variables[ "checkError" ] = variables[ "tmp_checkError_30942F4D0BCB6139072EF27C66218715" ];
this[ "checkError" ] = variables[ "tmp_checkError_30942F4D0BCB6139072EF27C66218715" ];
// Clean up
structDelete( variables, "tmp_checkError_30942F4D0BCB6139072EF27C66218715" );
structDelete( this, "tmp_checkError_30942F4D0BCB6139072EF27C66218715" );
public any function tmp_checkError_30942F4D0BCB6139072EF27C66218715(
) output=true {
var results = this._mockResults;
var resultsKey = "checkError";
var resultsCounter = 0;
var internalCounter = 0;
var resultsLen = 0;
var callbackLen = 0;
var argsHashKey = resultsKey & "|" & this.mockBox.normalizeArguments( arguments );
var fCallBack = "";
// If Method & argument Hash Results, switch the results struct
if (structKeyExists( this._mockArgResults, argsHashKey) ) {
// Check if it is a callback
if (isStruct( this._mockArgResults[ argsHashKey ]) &&
structKeyExists( this._mockArgResults[ argsHashKey ], "type" ) &&
structKeyExists( this._mockArgResults[ argsHashKey ], "target" ) ) {
fCallBack = this._mockArgResults[ argsHashKey ].target;
} else {
// switch context and key
results = this._mockArgResults;
resultsKey = argsHashKey;
}
}
// Get the statemachine counter
if (isSimpleValue( fCallBack) ) {
resultsLen = arrayLen( results[ resultsKey ] );
}
// Get the callback counter, if it exists
if (structKeyExists( this._mockCallbacks, resultsKey) ) {
callbackLen = arrayLen( this._mockCallbacks[ resultsKey ] );
}
// Log the Method Call
this._mockMethodCallCounters[ listFirst( resultsKey, "|" ) ] = this._mockMethodCallCounters[ listFirst( resultsKey, "|" ) ] + 1;
// Get the CallCounter Reference
internalCounter = this._mockMethodCallCounters[listFirst(resultsKey,"|")];
arrayAppend( this._mockCallLoggers["checkError"], arguments );
if (resultsLen neq 0) {
if (internalCounter gt resultsLen) {
resultsCounter = internalCounter - ( resultsLen * fix( ( internalCounter - 1 ) / resultsLen ) );
return results[ resultsKey ][ resultsCounter ];
} else {
return results[ resultsKey ][ internalCounter ];
}
}
if ( callbackLen neq 0 ) {
fCallBack = this._mockCallbacks[ resultsKey ].first();
return fCallBack( argumentCollection : arguments );
}
if ( not isSimpleValue( fCallBack ) ){
return fCallBack( argumentCollection : arguments );
}
}
</cfscript>