We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68f723a commit ccee9bdCopy full SHA for ccee9bd
system/testing/BaseTestCase.cfc
@@ -604,14 +604,18 @@ component extends="testbox.system.compat.framework.TestCase" accessors="true" {
604
.each( function( name ){
605
mockedEvent.setValue( arguments.name, params[ arguments.name ] );
606
} );
607
- arguments.headers
608
- .keyArray()
609
- .each( function( name ){
610
- mockedEvent
611
- .$( "getHTTPHeader" )
612
- .$args( arguments.name )
613
- .$results( headers[ arguments.name ] );
614
- } );
+ mockedEvent
+ .$(
+ method="getHTTPHeader",
+ callback=function( name, defaultValue ){
+ if( headers.keyExists( arguments.name ) ){
+ return headers[ arguments.name ];
+ }
+ if( !isNull( arguments.defaultValue ) ){
615
+ return arguments.defaultValue;
616
617
618
+ );
619
return this.execute( argumentCollection = arguments );
620
}
621
0 commit comments