Commit | Line | Data |
a78e3fed |
1 | use strict; |
c2849787 |
2 | use lib qw(t/lib); |
fbd83464 |
3 | use dbixcsl_common_tests; |
8fdd52a2 |
4 | use Test::More; |
a78e3fed |
5 | |
9e978a19 |
6 | my $dsn = $ENV{DBICTEST_MYSQL_DSN} || ''; |
7 | my $user = $ENV{DBICTEST_MYSQL_USER} || ''; |
8 | my $password = $ENV{DBICTEST_MYSQL_PASS} || ''; |
9 | my $test_innodb = $ENV{DBICTEST_MYSQL_INNODB} || 0; |
a78e3fed |
10 | |
9e978a19 |
11 | my $skip_rels_msg = 'You need to set the DBICTEST_MYSQL_INNODB environment variable to test relationships'; |
a78e3fed |
12 | |
fbd83464 |
13 | my $tester = dbixcsl_common_tests->new( |
52bf3f26 |
14 | vendor => 'Mysql', |
15 | auto_inc_pk => 'INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT', |
16 | innodb => $test_innodb ? q{Engine=InnoDB} : 0, |
17 | dsn => $dsn, |
18 | user => $user, |
19 | password => $password, |
20 | skip_rels => $test_innodb ? 0 : $skip_rels_msg, |
21 | no_inline_rels => 1, |
22 | no_implicit_rels => 1, |
8fdd52a2 |
23 | extra => { |
24 | create => [ |
25 | qq{ |
26 | CREATE TABLE mysql_loader_test1 ( |
27 | id INTEGER UNSIGNED NOT NULL PRIMARY KEY |
28 | ) |
29 | }, |
30 | ], |
31 | drop => [ qw/ mysql_loader_test1 / ], |
32 | count => 1, |
33 | run => sub { |
34 | my ($schema, $monikers, $classes) = @_; |
35 | |
36 | my $rs = $schema->resultset($monikers->{mysql_loader_test1}); |
37 | my $column_info = $rs->result_source->column_info('id'); |
38 | |
39 | is($column_info->{extra}->{unsigned}, 1, 'Unsigned MySQL columns'); |
40 | }, |
41 | } |
a78e3fed |
42 | ); |
43 | |
9e978a19 |
44 | if( !$dsn || !$user ) { |
45 | $tester->skip_tests('You need to set the DBICTEST_MYSQL_DSN, _USER, and _PASS environment variables'); |
a78e3fed |
46 | } |
47 | else { |
48 | $tester->run_tests(); |
49 | } |