Test::DatabaseRowSimple database tests | |
Download |
Test::DatabaseRow Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Publisher Name:
- Mark Fowler
- Publisher web site:
- http://search.cpan.org/~markf/
Test::DatabaseRow Tags
Test::DatabaseRow Description
Simple database tests Test::DatabaseRow is a simple Perl module for doing very very simple quick tests on a database, primarily designed to test if a row exists with the correct details in a table or not. For more advanced testing (joins, etc) it's probably easier for you to roll your own tests by hand than use this module.SYNOPSIS use Test::More tests => 3; use Test::DatabaseRow; # set the default database handle local $Test::DatabaseRow::dbh = $dbh; # sql based test row_ok( sql => "SELECT * FROM contacts WHERE cid = '123'", tests => , label => "contact 123's name is trelane"); # test with shortcuts row_ok( table => "contacts", where => , tests => , label => "contact 123's name is trelane"); # complex test row_ok( table => "contacts", where => { '=' => { name => "trelane" }, 'like' => { url => '%shortplanks.com' },}, tests => { '==' => { cid => 123, num => 134 }, 'eq' => { person => "Mark Fowler" }, '=~' => { road => qr/Liverpool R.?.?d/ },}, label => "trelane entered into contacts okay" ); Requirements: · Perl
Test::DatabaseRow Related Software