This commit was generated by cvs2svn to compensate for changes in r3921,
[freeside.git] / rt / lib / t / 02regression.t.in
1 #!@PERL@
2
3 use Test::More qw(no_plan);
4
5 use lib "@RT_LIB_PATH@";
6 use RT;
7 ok(RT::LoadConfig);
8 ok(RT::Init, "Basic initialization and DB connectivity");
9
10 # Create a new queue
11 use_ok(RT::Queue);
12 my $q = RT::Queue->new($RT::SystemUser);
13
14 $q->Load('regression');
15 if ($q->id != 0) {
16         die "Regression tests not starting with a clean DB. Bailing";
17 }
18
19 my ($id, $msg) = $q->Create( Name => 'Regression',
20             Description => 'A regression test queue',
21             CorrespondAddress => 'correspond@a',
22             CommentAddress => 'comment@a');
23
24 isnt($id, 0, "Queue was created sucessfully - $msg");
25
26 my $q2 = RT::Queue->new($RT::SystemUser);
27
28 ok($q2->Load($id));
29 is($q2->id, $id, "Sucessfully loaded the queue again");
30 is($q2->Name, 'Regression');
31 is($q2->Description, 'A regression test queue');
32 is($q2->CorrespondAddress, 'correspond@a');
33 is($q2->CommentAddress, 'comment@a');
34
35
36 use File::Find;
37 File::Find::find({wanted => \&wanted_autogen,   
38         preprocess => sub {return sort @_}}, 'lib/t/autogen');
39 sub wanted_autogen { /^autogen.*\.t\z/s && require $_; }
40
41 File::Find::find({wanted => \&wanted_regression,
42         preprocess => sub {return sort @_}}, 'lib/t/regression');
43 sub wanted_regression { /^*\.t\z/s && require $_; }
44
45 require "@RT_LIB_PATH@/t/03web.pl";
46 require "@RT_LIB_PATH@/t/04_send_email.pl";
47 require "@RT_LIB_PATH@/t/05cronsupport.pl";