ePages 7.27.0 - DE_EPAGES/Shop/API/Test.pm

Package DE_EPAGES::Shop::API::Test

Base class for tests that require a shop

Base
DE_EPAGES::Database::API::Test
Example
package MyTest;
use base DE_EPAGES::Shop::API::Test;
use Test::More tests => 1;

sub test {
    my $self = shift;
    my $Shop = $self->shop;
    ok( 1, 'selftest' );
}

sub init { #optional
    my $self = shift;
    $self->SUPER::init; # creates the shop
    my $Shop = $self->shop;
}

sub cleanup { # optional
    my $self = shift;
    my $Shop = $self->shop;
    $self->SUPER::cleanup; # deletes the shop
}

__PACKAGE__->runScript;
1;

Functions

cleanup
init
shop

cleanup

Deletes the test shop unless the environment variable SKIP_CLEANUP is true.

Syntax
$Test->cleanup;

init

Creates a new test shop unless the test shop already exists and the environment variable SKIP_CLEANUP is true.

Syntax
$Test->init;

shop

Returns the test shop object.

Syntax
$Shop = $Test->shop;
Return
$Shop (DE_EPAGES::Shop::API::Object::Shop)
test shop