<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

Freeside testing suite

NAME

Freeside testing suite

SYNOPSIS

  use Test::More 'tests' => 1;
  use FS::Test;
  my $FS = FS::Test->new;
  $FS->post('/edit/cust_main.cgi', ... ); # form fields
  ok( !$FS->error );

PROPERTIES

page

The content of the most recent page fetched from the UI.

redirect

The redirect location (relative to the Freeside root) of the redirect returned from the UI, if there was one.

CLASS METHODS

new OPTIONS

Creates a test session. OPTIONS may contain:

- user: the Freeside test username [test] - base: the fake base URL for Mason to use [http://fake.freeside.biz]

METHODS

post PATH, PARAMS
post FORM

Submits a request to PATH, through the Mason UI, with arguments in PARAMS. This will be converted to a URL query string. Anything returned by the UI will be in the page() property.

Alternatively, takes an HTML::Form object (with fields filled in, via the param() method) and submits it.

proceed

If the last request returned a redirect, follow it.

forms

For the most recently returned page, returns a list of HTML::Forms found.

form NAME

For the most recently returned page, returns an HTML::Form object representing the form named NAME. You can then call methods like value(inputname, inputvalue) to set the values of inputs on the form, and then pass the form object to "post" to submit it.

qsearch ARGUMENTS

Searches the database, like FS::Record::qsearch.

qsearchs ARGUMENTS

Searches the database for a single record, like FS::Record::qsearchs.

new_customer FIRSTNAME

Returns an FS::cust_main object full of default test data, ready to be inserted. This doesn't insert the customer, because you might want to change some things first. FIRSTNAME is recommended so you know which test the customer was used for.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 43:

You forgot a '=back' before '=head1'

Around line 45:

'=item' outside of any '=over'

Around line 97:

=over without closing =back

<% include ('/elements/footer.html' ) %>