ePages 6.17.35 - DE_EPAGES/Database/API/Test.pm

Package DE_EPAGES::Database::API::Test

Base class for tests that require a database connection

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

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

sub init {
    my $self = shift;
    my $dbi = $self->dbi;
}

sub cleanup {
    my $self = shift;
    my $dbi = $self->dbi;
}

__PACKAGE__->runScript;
1;

Functions

dbi
run

dbi

Returns the current global database handle.

Syntax
$dbi = $Test->dbi;
Return
$dbi (DE_EPAGES::Database::API::DBI)
database handle

run

Connects to the test database ($ENV{EPAGES_TESTSITE}) and runs the test case using $self->DE_EPAGES::Database::API::Test::run.

Syntax
$Test->run;