Logic Operation - Eval

The Eval operation is used to perform internal manipulation of variables.

Attributes

The operation attributes are as follows.

Attribute Type Description
type String eval
expression String [Required] The expression to evaluate, typically referencing $v, $i or $g.
This attribute is always evaluated as an expression.
tests Array of Object An array of anonymous Objects. Each Object represents a check to be performed. The associated Pass/Fail entries will be generated in the test instance check_log. Refer to the Operation Tests documentation for more information on the syntext for Operation tests.
.kpath String [Required] This is the "kpath" which locates the response element which is to be validated by this check. See the preceeding list of top-level elements available to KPath. Refer to the KPath documentation for more information on KPath syntax. See below of a list of KPath elements available for this operation.
.type String [Required] The type of test to perform. This is either string (compare as string), integer (compare as integer), timestamp (verify a timestamp, including comparison to the current time), size (verify the length of an array), or ordered_str_array (verify the length, sequence and content of a received array of strings).
.value String/Integer/Array [Required] This object specifies the expected value to check against the actual returned value matched by the KPath. To check that an returned element is not present, specify null for the expected value.

Example

This is an example entry within the operations array:

{ 
    "type": "eval", 
    "label": "increment3", 
    "expression": "$v->{threshold} = $v->{threshold} + 3",
    "tests": [
        { kpath: ".", "type": "string", "value": "4" }
    ]
}