|
NAMETest::Fixture::DBI - load fixture data to database. SYNOPSIS use DBI;
use File::Temp qw(tempfile);
use Test::More;
use Test::Fixture::DBI;
my ( undef, $filename ) = tempfile;
my $dbh = DBI->connect( "dbi:SQLite:dbname=$filename", "", "" );
construct_database(
dbh => $dbh,
database => '/path/to/schema.yaml',
);
construct_fixture(
dbh => $dbh,
fixture => '/path/to/fixture.yaml',
);
DESCRIPTIONTest::Fixture::DBI is fixture test library for DBI. SETUPBefore using this module, you must create database definition and fixture data. The following is creating database definition using make_database_yaml.pl. $ make_database_yaml.pl -d "dbi:mysql:dbname=social;host=testdb" -u root -p password -o /path/to/schema.yaml Next step is create fixture, $ make_fixture_yaml.pl -d "dbi:mysql:dbname=social;host=testdb" -u root -p password -t activity -n id \
-e "SELECT * FROM activity WHERE app_id = 12 ORDER BY created_on DESC LIMIT 10" -o /path/to/fixture.yaml
FUNCTIONSconstruct_database( %specs )The following is %specs details
construct_fixture( %specs )The following is %specs details construct_trigger( %specs )The following is %specs details AUTHORToru Yamaguchi <zigorou@cpan.org> Yuji Shimada <xaicron@cpan.org> SEE ALSOLICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|