GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::FIXTURE::DBI (3)

.ds Aq ’

NAME

Test::Fixture::DBI - load fixture data to database.

CONTENTS

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,
  );



DESCRIPTION

Test::Fixture::DBI is fixture test library for DBI.

SETUP

Before 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



FUNCTIONS

construct_database( CW%specs )

The following is %specs details
dbh Required parameter. dbh is DBI’s DBI::db object;
database Required parameter. database is ARRAYREF or SCALAR. specify database name.
schema Optional parameter. schema is ARRAYREF. if schema parameter is specified, then load particular schema from database.
procedure Optional parameter. procedure is ARRAYREF. if procedure parameter is specified, then load particular procedures from database.
function Optional parameter. function is ARRAYREF. if function parameter is specified, then load particular functions from database.
index Optional parameter. index is ARRAYREF. if index parameter is specified, then load particular indexes from database.

construct_fixture( CW%specs )

The following is %specs details
dbh Required parameter. dbh is DBI’s DBI::db object;
fixture Required parameter. fixture is SCALAR or ARRAYREF, Specify fixture files.
opts Optional parameter. opts is HASHREF. opts has bulk_insert key. if the bulk_insert value is true, then using bulk insert on loading fixture data.

construct_trigger( CW%specs )

The following is %specs details
dbh Required parameter. dbh is DBI’s DBI::db object;
database Optional parameter. database is SCALAR. specify database name.
schema Optional parameter. schema is ARRAYREF. if schema parameter is specified, then create particular triggers related specified schema on the database.

AUTHOR

Toru Yamaguchi <zigorou@cpan.org>

Yuji Shimada <xaicron@cpan.org>

SEE ALSO

Test::Fixture::DBIC::Schema
Test::Fixture::DBIxSkinny

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::FIXTURE::DBI (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.