coldbox.system.testing.mock.web

Class MockController

lucee.Component
    extended by coldbox.system.web.Controller
      extended by coldbox.system.testing.mock.web.MockController

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- A mock controller used for integration testing via TestBox

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Constructor Summary
    init(any appRootPath, [any appKey='cbController'])
          Constructor.
    Method Summary
    any relocate([any event='[runtime expression]'], [any queryString=''], [boolean addToken='false'], [any persist=''], [struct persistStruct='[runtime expression]'], [any baseURL=''], [boolean postProcessExempt='false'], [any URL], [any URI], [numeric statusCode='0'])
         Set the next event to run and relocate the browser to that event.
    any setNextEvent([any event='[runtime expression]'], [any queryString=''], [boolean addToken='false'], [any persist=''], [struct persistStruct='[runtime expression]'], [any baseURL=''], [boolean postProcessExempt='false'], [any URL], [any URI], [numeric statusCode='0'])
         Set the next event to run and relocate the browser to that event.
     
    Methods inherited from class coldbox.system.web.Controller
    _runEvent, getAppHash, getAppKey, getAppRootPath, getCache, getCachebox, getCFMLEngine, getColdboxInitiated, getColdboxSettings, getConfigSettings, getDataMarshaller, getHandlerService, getInterceptorService, getLoaderService, getLog, getLogbox, getMemento, getModuleService, getPlugin, getRenderer, getRequestService, getRoutingService, getServices, getSetting, getSettingStructure, getUtil, getWirebox, invoker, loadColdBoxSettings, locateDirectoryPath, locateFilePath, persistVariables, runEvent, sendRelocation, setAppHash, setAppKey, setAppRootPath, setCachebox, setCFMLEngine, setColdboxInitiated, setColdboxSettings, setConfigSettings, setLog, setLogbox, setServices, setSetting, settingExists, setUtil, setWirebox, updateSSL, validateAction
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any appRootPath, [any appKey='cbController'])

    Constructor

    Parameters:
    appRootPath
    appKey

    Method Detail

    relocate

    public any relocate([any event='[runtime expression]'], [any queryString=''], [boolean addToken='false'], [any persist=''], [struct persistStruct='[runtime expression]'], [any baseURL=''], [boolean postProcessExempt='false'], [any URL], [any URI], [numeric statusCode='0'])

    Set the next event to run and relocate the browser to that event. If you are in SES mode, this method will use routing instead. You can also use this method to relocate to an absolute URL or a relative URI

    Overrides:
    relocate in class Controller
    Parameters:
    event - The name of the event to relocate to, if not passed, then it will use the default event found in your configuration file.
    queryString - The query string to append, if needed. If in SES mode it will be translated to convention name value pairs
    addToken - Wether to add the tokens or not to the relocation. Default is false
    persist - What request collection keys to persist in flash RAM automatically for you
    persistStruct - A structure of key-value pairs to persist in flash RAM automatically for you
    baseURL - Use this baseURL instead of the index.cfm that is used by default. You can use this for SSL or any full base url you would like to use. Ex: https://mysite.com/index.cfm
    postProcessExempt - Do not fire the postProcess interceptors, by default it does
    URL - The full URL you would like to relocate to instead of an event: ex: URL='http://www.google.com'
    URI - The relative URI you would like to relocate to instead of an event: ex: URI='/mypath/awesome/here'
    statusCode - The status code to use in the relocation

    setNextEvent

    public any setNextEvent([any event='[runtime expression]'], [any queryString=''], [boolean addToken='false'], [any persist=''], [struct persistStruct='[runtime expression]'], [any baseURL=''], [boolean postProcessExempt='false'], [any URL], [any URI], [numeric statusCode='0'])

    Set the next event to run and relocate the browser to that event. If you are in SES mode, this method will use routing instead. You can also use this method to relocate to an absolute URL or a relative URI

    Parameters:
    event - The name of the event to relocate to, if not passed, then it will use the default event found in your configuration file.
    queryString - The query string to append, if needed. If in SES mode it will be translated to convention name value pairs
    addToken - Wether to add the tokens or not to the relocation. Default is false
    persist - What request collection keys to persist in flash RAM automatically for you
    persistStruct - A structure of key-value pairs to persist in flash RAM automatically for you
    baseURL - Use this baseURL instead of the index.cfm that is used by default. You can use this for SSL or any full base url you would like to use. Ex: https://mysite.com/index.cfm
    postProcessExempt - Do not fire the postProcess interceptors, by default it does
    URL - The full URL you would like to relocate to instead of an event: ex: URL='http://www.google.com'
    URI - The relative URI you would like to relocate to instead of an event: ex: URI='/mypath/awesome/here'
    statusCode - The status code to use in the relocation