DBIx-Custom / t / common-mysql.t /
Newer Older
77 lines | 2.5kb
added common test executing ...
Yuki Kimoto authored on 2011-08-07
1
use strict;
2
use warnings;
3

            
4
use FindBin;
test cleanup
Yuki Kimoto authored on 2011-08-15
5
use lib "$FindBin::Bin/common";
added common test executing ...
Yuki Kimoto authored on 2011-08-07
6
$ENV{DBIX_CUSTOM_TEST_RUN} = 1
added run file
Yuki Kimoto authored on 2011-08-13
7
  if -f "$FindBin::Bin/run/common-mysql.run";
added common test executing ...
Yuki Kimoto authored on 2011-08-07
8
$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'mysql private test';
9

            
test cleanup
Yuki Kimoto authored on 2011-08-15
10

            
11

            
added common test executing ...
Yuki Kimoto authored on 2011-08-07
12
use DBIx::Custom;
13
{
cleanup
Yuki Kimoto authored on 2012-01-20
14
  package DBIx::Custom;
15
  no warnings 'redefine';
finised mysql test cleanup
Yuki Kimoto authored on 2011-08-15
16

            
cleanup
Yuki Kimoto authored on 2012-01-20
17
  my $table1 = 'table1';
18
  my $table2 = 'table2';
19
  my $table2_alias = 'table2_alias';
20
  my $table3 = 'table3';
21
  my $key1 = 'key1';
22
  my $key2 = 'key2';
23
  my $key3 = 'key3';
24
  my $key4 = 'key4';
25
  my $key5 = 'key5';
26
  my $key6 = 'key6';
27
  my $key7 = 'key7';
28
  my $key8 = 'key8';
29
  my $key9 = 'key9';
30
  my $key10 = 'key10';
finised mysql test cleanup
Yuki Kimoto authored on 2011-08-15
31

            
cleanup
Yuki Kimoto authored on 2012-01-20
32
  has table1 => $table1;
33
  has table2 => $table2;
34
  has table2_alias => $table2_alias;
35
  has table3 => $table3;
36
  has key1 => $key1;
37
  has key2 => $key2;
38
  has key3 => $key3;
39
  has key4 => $key4;
40
  has key5 => $key5;
41
  has key6 => $key6;
42
  has key7 => $key7;
43
  has key8 => $key8;
44
  has key9 => $key9;
45
  has key10 => $key10;
cleanup
Yuki Kimoto authored on 2011-08-10
46

            
cleanup
Yuki Kimoto authored on 2012-01-20
47
  my $date_typename = 'Date';
48
  my $datetime_typename = 'Datetime';
49
  
50
  sub date_typename { lc $date_typename }
51
  sub datetime_typename { lc $datetime_typename }
test cleanup
Yuki Kimoto authored on 2011-08-10
52

            
cleanup
Yuki Kimoto authored on 2012-01-20
53
  my $date_datatype = 9;
54
  my $datetime_datatype = 11;
55
  
56
  sub date_datatype { lc $date_datatype }
57
  sub datetime_datatype { lc $datetime_datatype }
test cleanup
Yuki Kimoto authored on 2011-08-10
58

            
cleanup
Yuki Kimoto authored on 2012-01-20
59
  no warnings 'redefine';
60
  has dsn => "dbi:mysql:database=dbix_custom";
61
  has user => 'dbix_custom';
62
  has password => 'dbix_custom';
63
  
64
  sub create_table1 { "create table $table1 ($key1 varchar(255), $key2 varchar(255)) engine=InnoDB" }
65
  sub create_table1_2 { "create table $table1 ($key1 varchar(255), $key2 varchar(255), "
66
   . "$key3 varchar(255), key4 varchar(255), key5 varchar(255)) engine=InnoDB" }
67
  sub create_table1_type { "create table $table1 ($key1 $date_typename, $key2 $datetime_typename) engine=InnoDB" }
68
  sub create_table1_highperformance { "create table $table1 ($key1 varchar(255), $key2 varchar(255), "
69
    . "$key3 varchar(255), $key4 varchar(255), $key5 varchar(255), $key6 varchar(255), $key7 varchar(255)) engine=InnoDB" }
70
  sub create_table2 { "create table $table2 ($key1 varchar(255), $key3 varchar(255)) engine=InnoDB" }
71
  sub create_table2_2 { "create table $table2 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255)) engine=InnoDB" }
72
  sub create_table3 { "create table $table3 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255)) engine=InnoDB" }
73
  sub create_table_reserved {
74
    'create table `table` (`select` varchar(255), `update` varchar(255)) engine=InnoDB' }
added common test executing ...
Yuki Kimoto authored on 2011-08-07
75
}
76

            
77
require "$FindBin::Bin/common.t";