% 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
use Test::More 'tests' => 1;
use FS::Test;
my $FS = FS::Test->new;
$FS->post('/edit/cust_main.cgi', ... ); # form fields
ok( !$FS->error );
The content of the most recent page fetched from the UI.
The redirect location (relative to the Freeside root) of the redirect returned from the UI, if there was one.
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]
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.
If the last request returned a redirect, follow it.
For the most recently returned page, returns a list of HTML::Forms found.
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.
Searches the database, like FS::Record::qsearch.
Searches the database for a single record, like FS::Record::qsearchs.
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.
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head1'
'=item' outside of any '=over'
=over without closing =back