Skip to content

Commit

Permalink
Revert "Use a callback to handle dynamic getHttpHeader calls in testi…
Browse files Browse the repository at this point in the history
…ng (#595)"

This reverts commit 47a1cd0.
  • Loading branch information
lmajano committed Jan 20, 2025
1 parent 6c95337 commit 359e4d3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions system/testing/BaseTestCase.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,14 @@ component extends="testbox.system.compat.framework.TestCase" accessors="true" {
.each( function( name ){
mockedEvent.setValue( arguments.name, params[ arguments.name ] );
} );
mockedEvent.$(
method = "getHTTPHeader",
callback = function( name, defaultValue ){
if ( headers.keyExists( arguments.name ) ) {
return headers[ arguments.name ];
}
if ( !isNull( arguments.defaultValue ) ) {
return arguments.defaultValue;
}
}
);
arguments.headers
.keyArray()
.each( function( name ){
mockedEvent
.$( "getHTTPHeader" )
.$args( arguments.name )
.$results( headers[ arguments.name ] );
} );
return this.execute( argumentCollection = arguments );
}

Expand Down

0 comments on commit 359e4d3

Please sign in to comment.