Package DE_EPAGES::Test::Mock::MockifyServlet
framework to mock an epages Servlet based on mockify
Base |
DE_EPAGES::Test::Mock::Mockify |
Example |
my $AddressObject = DE_EPAGES::Test::Mock::EpagesObject->new('DE_EPAGES::Address::API::Object::Address',{}) my $MockifyServlet = DE_EPAGES::Test::Mock::MockifyServlet->new( $AddressObject ); $MockifyServlet->addVar('username', 'mustermann', {'string'=>'mayer'}); my $Servlet = $MockifyServlet->getMockObject(); $Servlet->vars(); # return the whole hash $Servlet->vars('username'); # return 'mustermann' $Servlet->vars('username','mayer'); # proof value and return 'mayer' to add multiple Variables without a value check use: $MockifyServlet->addVars({'key1'=>'value1', 'key2'=>'value2', ...}); |
Functions
addVar
add a variables to servlet the $Validator is optional addVar( 'Key', 'Value' ) addVar( 'Key', 'Value', 'string' ) addVar( 'Key', 'Value', {'string' => 'abcd'} ) The Validator test the value when using the $servlet->vars() as setter
Syntax |
addVar( $Key, $Value, $Validator ); |
Input |
|
addVars
add the variables to the servlet withVars({'username', 'mustermann'});
Syntax |
addVars( $hVars ); |
Input |
|
new
constructor
Syntax |
new( $ObjectInServlet ); |
Input |
|
Return |
|