c0ef36732caeacdcd2b060f62badbd2d2c0f5d56
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / backcompat / 0.04006 / 11mysql_common.t
1 use strict;
2 use lib qw(t/backcompat/0.04006/lib);
3 use dbixcsl_common_tests;
4 use Test::More;
5 plan skip_all => 'set SCHEMA_LOADER_TESTS_BACKCOMPAT to enable these tests'
6     unless $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT};
7
8
9 my $dsn         = $ENV{DBICTEST_MYSQL_DSN} || '';
10 my $user        = $ENV{DBICTEST_MYSQL_USER} || '';
11 my $password    = $ENV{DBICTEST_MYSQL_PASS} || '';
12 my $test_innodb = $ENV{DBICTEST_MYSQL_INNODB} || 0;
13
14 my $skip_rels_msg = 'You need to set the DBICTEST_MYSQL_INNODB environment variable to test relationships';
15
16 my $tester = dbixcsl_common_tests->new(
17     vendor           => 'Mysql',
18     auto_inc_pk      => 'INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT',
19     innodb           => $test_innodb ? q{Engine=InnoDB} : 0,
20     dsn              => $dsn,
21     user             => $user,
22     password         => $password,
23     skip_rels        => $test_innodb ? 0 : $skip_rels_msg,
24     no_inline_rels   => 1,
25     no_implicit_rels => 1,
26 );
27
28 if( !$dsn || !$user ) {
29     $tester->skip_tests('You need to set the DBICTEST_MYSQL_DSN, _USER, and _PASS environment variables');
30 }
31 else {
32     $tester->run_tests();
33 }