Mockbox: How to mock the CGI scope

Is it possible to mock the CGI scope in Mockbox? Running the following code results in an “empty string” error being thrown.

variables.CUT.$property(propertyName="HTTP_HOST", propertyScope="cgi", mock="www.the_domain_name.co.uk");

Simon,

Unfortunately the CGI scope is a read only scope in CF. So in order to do what you want you will need to refactor the way you are using it so you wrap the access to the CGI entry via a method. Then you can mock the method.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Ok. Thanks Luis.