function createMock(oPayload, bFail, sDate, sLastModified, sETag) {
		var jqXHR = new jQuery.Deferred();

		setTimeout(function () {
			if (bFail) {
				jqXHR.reject(oPayload);
			} else {
				jqXHR.resolve(oPayload, "OK", { // mock jqXHR for success handler
					getResponseHeader : function (sName) {
						// Note: getResponseHeader treats sName case insensitive!
						// Thus productive code can safely use the nice capitalization only.
						// Mock does not need to implement case insensitivity!
						switch (sName) {
							case "Date":
								return sDate || null;
							case "ETag":
								return sETag || null;
							case "Last-Modified":
								return sLastModified || null;
							default:
								QUnit.assert.ok(false,
									"unexpected getResponseHeader(" + sName + ")");
						}
					}
				});
			}
		}, 0);

		return jqXHR;
	}
/**
	 * Creates a mock for jQuery's XHR wrapper.
	 *
	 * @param {object} oPayload
	 *   the response payload
	 * @param {boolean} [bFail]
	 *   fail if true
	 * @param {string} [sDate=null]
	 *   value of "Date" response header
	 * @param {string} [sLastModified=null]
	 *   value of "Last-Modified" response header
	 * @param {string} [sETag=null]
	 *   value of "ETag" response header
	 * @returns {object}
	 *   a mock for jQuery's XHR wrapper
	 */
Creates a mock for jQuery's XHR wrapper.
Creates a mock for jQuery ' s XHR wrapper .
function createMock(oPayload, bFail, sDate, sLastModified, sETag) {
		var jqXHR = new jQuery.Deferred();
		setTimeout(function () {
			if (bFail) {
				jqXHR.reject(oPayload);
			} else {
				jqXHR.resolve(oPayload, "OK", { 
					getResponseHeader : function (sName) {
						switch (sName) {
							case "Date":
								return sDate || null;
							case "ETag":
								return sETag || null;
							case "Last-Modified":
								return sLastModified || null;
							default:
								QUnit.assert.ok(false,
									"unexpected getResponseHeader(" + sName + ")");
						}
					}
				});
			}
		}, 0);
		return jqXHR;
	}
function createMock ( oPayload , bFail , sDate , sLastModified , sETag ) { var jqXHR = new jQuery . Deferred ( ) ; setTimeout ( function ( ) { if ( bFail ) { jqXHR . reject ( oPayload ) ; } else { jqXHR . resolve ( oPayload , "OK" , { getResponseHeader : function ( sName ) { switch ( sName ) { case "Date" : return sDate || null ; case "ETag" : return sETag || null ; case "Last-Modified" : return sLastModified || null ; default : QUnit . assert . ok ( false , "unexpected getResponseHeader(" + sName + ")" ) ; } } } ) ; } } , 0 ) ; return jqXHR ; }
Creates a mock for jQuery's XHR wrapper.
Creates a mock for jQuery ' s XHR wrapper .
// mock jqXHR for success handler // Note: getResponseHeader treats sName case insensitive! // Thus productive code can safely use the nice capitalization only. // Mock does not need to implement case insensitivity!