Test::DBUnit::Genertor - dbunit dataset generator
use Test::DBUnit::Generator; my $connection = DBIx::Connection->new( name => 'test', dsn => $ENV{DB_TEST_CONNECTION}, username => $ENV{DB_TEST_USERNAME}, password => $ENV{DB_TEST_PASSWORD}, ); my $generator = Test::DBUnit::Generator->new( connection => $connection, datasets => { emp => 'SELECT * FROM emp', dept => 'SELECT * FROM demp', }, ); print $generator->xml; print $generator->perl;
This class generates xml or perl test datasets based on passed in sql
Returns xml content that contains dataset
Returns dataset structure
To install Test::DBUnit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::DBUnit
CPAN shell
perl -MCPAN -e shell install Test::DBUnit
For more information on module installation, please visit the detailed CPAN module installation guide.