4 use Test::More tests => 11;
10 sub fails { ok(!$_[0], "This should fail: $_[1]") }
11 sub works { ok($_[0], $_[1] || 'This works') }
15 return $class->new($RT::SystemUser);
18 my $q = new(RT::Queue);
19 works($q->Create(Name => "CF-Pattern-".$$));
21 my $cf = new(RT::CustomField);
22 my @cf_args = (Name => $q->Name, Type => 'Combobox', Queue => $q->id);
24 works($cf->Create(@cf_args));
26 # Set some CFVs with Category markers
28 my $t = new(RT::Ticket);
29 my ($id,undef,$msg) = $t->Create(Queue => $q->id, Subject => 'CF Test');
34 $cf->AddValue(Name => $_[0], Description => $_[0], Category => $_[1])
38 add_works('value1', '1. Category A');
40 add_works('value3', '1.1. A-sub one');
41 add_works('value4', '1.2. A-sub two');
42 add_works('value5', '');
44 my $cfv = $cf->Values->First;
45 is($cfv->Category, '1. Category A');
46 works($cfv->SetCategory('1. Category AAA'));
47 is($cfv->Category, '1. Category AAA');