DBIx-FixtureLoader
view release on metacpan or search on metacpan
t/03_mysql.t view on Meta::CPAN
unless ($@) {
note 'Text::CSV_XS version 0.99 or under has utf8 problem. force Text::CVS_PP.';
$ENV{PERL_TEXT_CSV} = 'Text::CSV_PP' if $Text::CSV_XS::VERSION < 1.00;
}
}
use DBI;
use DBIx::FixtureLoader;
use Test::Requires 'Test::mysqld';
my $mysqld = Test::mysqld->new(my_cnf => {'skip-networking' => ''}) or plan skip_all => $Test::mysqld::errstr;
my $dbh = DBI->connect($mysqld->dsn, '', '', {RaiseError => 1, mysql_enable_utf8 => 1}) or die 'cannot connect to db';
for my $cond ([], [bulk_insert => 0]) {
my @cond = @$cond;
my $bulk = @cond ? 'no bulk' : 'bulk insert';
note $bulk;
$dbh->do(q{DROP TABLE IF EXISTS item;});
$dbh->do(q{
CREATE TABLE item (
id INTEGER PRIMARY KEY,
t/04_empty.t view on Meta::CPAN
unless ($@) {
note 'Text::CSV_XS version 0.99 or under has utf8 problem. force Text::CVS_PP.';
$ENV{PERL_TEXT_CSV} = 'Text::CSV_PP' if $Text::CSV_XS::VERSION < 1.00;
}
}
use DBI;
use DBIx::FixtureLoader;
use Test::Requires 'Test::mysqld';
my $mysqld = Test::mysqld->new(my_cnf => {'skip-networking' => ''}) or plan skip_all => $Test::mysqld::errstr;
my $dbh = DBI->connect($mysqld->dsn, '', '', {RaiseError => 1, mysql_enable_utf8 => 1}) or die 'cannot connect to db';
$dbh->do(q{DROP TABLE IF EXISTS zero;});
$dbh->do(q{
CREATE TABLE zero (
id INTEGER PRIMARY KEY,
name VARCHAR(255)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
});
my $m = DBIx::FixtureLoader->new(
t/05_skip_null_column.t view on Meta::CPAN
note 'Text::CSV_XS version 0.99 or under has utf8 problem. force Text::CVS_PP.';
$ENV{PERL_TEXT_CSV} = 'Text::CSV_PP';
}
}
}
use DBI;
use DBIx::FixtureLoader;
use Test::Requires 'Test::mysqld';
my $mysqld = Test::mysqld->new(my_cnf => {'skip-networking' => ''}) or plan skip_all => $Test::mysqld::errstr;
my $dbh = DBI->connect($mysqld->dsn, '', '', {RaiseError => 1, mysql_enable_utf8 => 1}) or die 'cannot connect to db';
$dbh->do(q{SET SESSION sql_mode='TRADITIONAL'});
$dbh->do(q{DROP TABLE IF EXISTS item;});
$dbh->do(q{
CREATE TABLE item (
id INTEGER PRIMARY KEY,
name VARCHAR(255),
attribute TINYINT NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
});
( run in 0.260 second using v1.01-cache-2.11-cpan-00829025b61 )