4 use RT::Test nodata => 1, tests => 11;
6 my $q = RT::Queue->new($RT::SystemUser);
7 works($q->Create(Name => "CF-Pattern-".$$));
9 my $cf = RT::CustomField->new($RT::SystemUser);
10 my @cf_args = (Name => $q->Name, Type => 'Combobox', Queue => $q->id);
12 works($cf->Create(@cf_args));
14 # Set some CFVs with Category markers
16 my $t = RT::Ticket->new($RT::SystemUser);
17 my ($id,undef,$msg) = $t->Create(Queue => $q->id, Subject => 'CF Test');
22 $cf->AddValue(Name => $_[0], Description => $_[0], Category => $_[1])
26 add_works('value1', '1. Category A');
28 add_works('value3', '1.1. A-sub one');
29 add_works('value4', '1.2. A-sub two');
30 add_works('value5', '');
32 my $cfv = $cf->Values->First;
33 is($cfv->Category, '1. Category A');
34 works($cfv->SetCategory('1. Category AAA'));
35 is($cfv->Category, '1. Category AAA');