NAME

PSA::Test - for writing PSA regression tests

SYNOPSIS

use PSA::Test tests => 1;

SETUP_TEST(my $psa = shift);

is("this", "that", "This is that");

DESCRIPTION

PSA::Test is a class for writing short test scripts to run within the PSA environment.

The idea is, that you write a PSA scriptlet that tests your data model in some way, and then put such a page in your controller (psa-bin/) directory somewhere. This is somewhat incompatible with the style of placing such tests in the t/ folder, so you will probably choose one style or another.

It is modelled very closely on Schwern's Test::More module. Pieces are directly ripped off it. Largely because I couldn't inherit off it :-).

TEST FUNCTIONS

ok, pass, fail
is, isnt, cmp_ok
like, unlike

Identical to their Test::More counterparts in function.

can_ok

Similar to the Test::More version, but implemented in this module.

isa_ok

Similar to the Test::More version, but implemented in this module.

use_ok

Similar to the Test::More version, but implemented in this module.

Remember to use within a BEGIN { } block for maximum effect.

require_ok
require_ok($module);

Like use_ok(), except it requires the $module.

SETUP_TEST($psa)

Sets up the test environment - sets up where the `local' PSA object is.

$o->template

(internal) Returns the template that is adequate for displaying this set of test results, based on the configured settings of verbose, image, etc.

SEE ALSO

PSA, PSA::Cache::Entry