coldbox.system.testing

Class CustomMatchers

lucee.Component
    extended by coldbox.system.testing.CustomMatchers

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- All the custom matchers ColdBox registers within TestBox for easier testing!

Class Attributes:
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    any toHaveInvalidData([any expectation], [any args='[runtime expression]'])
         Expectation for testing again cbValidation invalid data fields returned in a Restful response.
    any toHaveStatus([any expectation], [any args='[runtime expression]'])
         Checks if the ColdBox response obejct has a matched status code.
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    toHaveInvalidData

    public any toHaveInvalidData([any expectation], [any args='[runtime expression]'])

    Expectation for testing again cbValidation invalid data fields returned in a Restful response by looking into the response object

    expect( event.getResponse() ).toHaveInvalidData( "username", "is required" )
    expect( event.getResponse() ).toHaveInvalidData( "role", "is required" )
    expect( event.getResponse() ).toHaveInvalidData( "permission", "is not unique" )
    expect( event.getResponse() ).toHaveInvalidData( "status", "does not match" )
    

    Parameters:
    expectation
    args

    toHaveStatus

    public any toHaveStatus([any expectation], [any args='[runtime expression]'])

    Checks if the ColdBox response obejct has a matched status code

    expect( event.getResponse() ).toHaveStatus( statusCode );
    

    Parameters:
    expectation
    args