This commit was generated by cvs2svn to compensate for changes in r8690,
[freeside.git] / rt / t / shredder / 03plugin_users.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;
5
6 use Test::Deep;
7 use File::Spec;
8 use Test::More tests => 9;
9 use RT::Test ();
10 BEGIN {
11     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
12         File::Spec->curdir());
13     require $shredder_utils;
14 }
15
16
17 my @ARGS = sort qw(limit status name member_of email replace_relations no_tickets);
18
19 use_ok('RT::Shredder::Plugin::Users');
20 {
21     my $plugin = new RT::Shredder::Plugin::Users;
22     isa_ok($plugin, 'RT::Shredder::Plugin::Users');
23
24     is(lc $plugin->Type, 'search', 'correct type');
25
26     my @args = sort $plugin->SupportArgs;
27     cmp_deeply(\@args, \@ARGS, "support all args");
28
29
30     my ($status, $msg) = $plugin->TestArgs( name => 'r??t*' );
31     ok($status, "arg name = 'r??t*'") or diag("error: $msg");
32
33     for (qw(any disabled enabled)) {
34         my ($status, $msg) = $plugin->TestArgs( status => $_ );
35         ok($status, "arg status = '$_'") or diag("error: $msg");
36     }
37     ($status, $msg) = $plugin->TestArgs( status => '!@#' );
38     ok(!$status, "bad 'status' arg value");
39 }
40