Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ledgersmb::dbtest(3pm) [debian man page]

LedgerSMB::DBTest(3pm)					User Contributed Perl Documentation				    LedgerSMB::DBTest(3pm)

NAME
LedgerSMB::DBTest - LedgerSMB commit filter for test cases. SYOPSIS
This module creates a DBI-like interface but ensures autocommit is off, and filters commit statements such that they don't do anything. This can be used for making API test cases which involve DB commits safe for production environments. USAGE
Both LedgerSMB.pm and LedgerSMB/Form.pm assign a global database handler for all database access within a script in the dbh property (for example, $request->{dbh} or $form->{dbh}). By setting this early to a LedgerSMB::DBTest (instead of a DBI object), the tests can be made safe. However, there are a few limitations to be aware of. One cannot run tests through the standard request handler and use this module. Hence this is limited to unit tests of files in the LedgerSMB, scripts, and bin directories. Here is an example of how this could be done: my $lsmb = LedgerSMB->new(); $lsmb->merge($testdata); my $dbh = LedgerSMB::DBTest->connect("dbi:Pg:dbname=$company", "$username", "$password",) $lsmb->{dbh} = $dbh; METHODS
connect($dsn, $user, $pass) Connects to the database and returns a LedgerSMB::DBTest object commit() Tests the current transaction (issues a 'SELECT 1;' to the database). If this is successful returns 1, if not, rolls back and returns false. Note that this means all past tests are rolled back and this is inconsistent with normal transactional behavior. prepare() Returns a statement handle, via the private DBI database handle. do() passes this statement on to the private database handle errstr() passes this call on to the private database handle err() passes this call on to the private database handle quote() passes this call on to the private database handle quote_identifier() passes this call on to the private database handle rollback() passes this call on to the private database handle. Note that this will roll back all statements issues through this object. perl v5.14.2 2010-03-02 LedgerSMB::DBTest(3pm)

Check Out this Related Man Page

LedgerSMB::Batch(3pm)					User Contributed Perl Documentation				     LedgerSMB::Batch(3pm)

NAME
LedgerSMB::Batch - Batch/voucher management model for LedgerSMB 1.3 SYNOPSIS
Batch/voucher management model for LedgerSMB 1.3 METHODS
get_new_info This gets the information required for the new batch screen. Currently this just populates the batch_number hashref value. create Saves the batch info and populates the id hashref value with the id inserted. delete_voucher($id) Deletes the voucher specified by $id. get_search_criteria Sets all hash values needed for the search interface: batch_classes List of all batch classes batch_users List of all users get_search_method (private) Determines the appropriate search method, either for empty, mini, or full searches Returns the appropriate stored proc name. get_search_results Returns the appropriate search as detected by get_search_method. get_class_id($type) Returns the class_id of batch class specified by its label. post Posts a batch to the books and makes the vouchers show up in transaction reports, financial statements, and more. delete Deletes the unapproved batch and all vouchers under it. list_vouchers Returns a list of all vouchers in the batch and attaches that list to $self->{vouchers} get Gets the batch and merges information with the current batch object. Copyright (C) 2009, The LedgerSMB core team. This file is licensed under the Gnu General Public License version 2, or at your option any later version. A copy of the license should have been included with your software. perl v5.14.2 2012-03-26 LedgerSMB::Batch(3pm)
Man Page