ePages 7.26.0 - DE_EPAGES/MultiStore/API/Test/HelperFunctions.pm

Package DE_EPAGES::MultiStore::API::Test::HelperFunctions

Helper functions for Synchronization integration tests

Base
Exporter
@EXPORT_OK
RunTestOnStore
SyncCache
SetTestLanguageID
GetTestLanguageID
SetVerbose
GetVerbose
DeleteObject
LoadDataFromFile
Output

Functions

DeleteObject
GetTestLanguageID
GetVerbose
LoadDataFromFile
Output
RunTestOnStore
SetTestLanguageID
SetVerbose
SyncCache

DeleteObject

Deletes an object (if exists)

Syntax
DeleteObject($ObjectPath);
Input
$ObjectPath (string)
Path to the object to delete
Return
$Installer (object)
cartridge installer

GetTestLanguageID

Getter for the LanguageID for all the tests

Syntax
$LanguageID = GetTestLanguageID();
Return
$LanguageID (integer)
The test language ID

GetVerbose

Getter for the current Verbose value

Syntax
$Verbose = GetVerbose();
Return
$Verbose (boolean)
Current verbose value

LoadDataFromFile

Loads a perl file content as data (array, hash, ...)

Syntax
$Data = LoadDataFromFile($DataFileName);
Input
$DataFileName (string)
Perl file name
Return
$Data (data)
Loaded data

Output

If Verbose is enabled prints output

Syntax
Output($Format, ...);
Example
Output("Hello world!");
Output("Prints a string '%s' and a number %d\n", 'text', 1234);
Input
$Format (string)
Format string used like sprintf arguments ...

RunTestOnStore

Runs code in a database connection

Syntax
RunTestOnStore($Storename, $TestCode);
Input
$Storename (string)
Store name for connection
$TestCode (sub)
Code to run inside the store connection

SetTestLanguageID

Sets the test LanguageID getting the ID from a specified Storename connection

Syntax
SetTestLanguageID($Storename);
Input
$Storename (string)
Storename for connection

SetVerbose

Enable/Disable output

Syntax
SetVerbose($Verbose);
Input
$Verbose (boolean)
Enables (1) or Disables (0) the output

SyncCache

Send sync cache event to Message center (update AppServers)

Syntax
SyncCache();