ePages 6.17.48 - DE_EPAGES/Test/Mock/Mockify/ServletVarsService.pm

Package DE_EPAGES::Test::Mock::Mockify::ServletVarsService

handle the the behavior of epages servlet->vars() for mockify

Functions

addVar
getVarValidator
new
setVarValidator
vars

addVar

add a variable for vars

Syntax
addVar( $Key, $Value );
Input
$Key (string)
key name
$Value (all types)
the value

getVarValidator

get the validator for a key if not defined it will return undef

Syntax
getVarValidator( $Input1 );
Input
$Key (string)
key name
Return
$Validator (string refhash)
string or hash ref

new

constructor

Syntax
new( );
Return
$self (DE_EPAGES::Test::Mock::ServletVarsService)
self

setVarValidator

set the validator for a key

Syntax
setVarValidator( $Key, $Validator );
Input
$Key (string)
key name
$Validator (string refhash)
string or hash ref

vars

Without parameter returns all set variables.
With one parameter (name of variable) the value of this variable will be returned.
With two parameter (name and value of variable) the value of this variable will be set.
If the Key is not initiated it will throw an error. If the Value is not like initiated it will throw an error.

Syntax
$hVars = $Servlet->vars;
$Value= $Servlet->vars($Name);
$Servlet->vars($Name, $Value);
Example
$Servlet->vars('OutputEncoding', 'ISO-8859-1');
Input
$Name (string)
name of variable (optional)
$Value (string)
value of variable (optional)
Return
$hVars (ref.hash)
set TLE variables as key value pairs
$Value (string)
value of given variable name