This commit was generated by cvs2svn to compensate for changes in r4888,
[freeside.git] / rt / lib / t / 02regression.t
1 #!/usr/bin/perl
2
3 use Test::More qw(no_plan);
4
5 use lib "/opt/rt3/lib";
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}, 'lib/t/autogen');
38 sub wanted_autogen { /^autogen.*\.t\z/s && require $_; }
39
40 File::Find::find({wanted => \&wanted_regression}, 'lib/t/regression');
41 sub wanted_regression { /^*\.t\z/s && require $_; }
42
43 require "/opt/rt3/lib/t/03web.pl";
44 require "/opt/rt3/lib/t/04_send_email.pl";