diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /rt/t/api/cf_external.t | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'rt/t/api/cf_external.t')
-rw-r--r-- | rt/t/api/cf_external.t | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/rt/t/api/cf_external.t b/rt/t/api/cf_external.t deleted file mode 100644 index 076871240..000000000 --- a/rt/t/api/cf_external.t +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; - -use RT; -use RT::Test nodata => 1, tests => 11; - -sub new (*) { - my $class = shift; - return $class->new($RT::SystemUser); -} - -use constant VALUES_CLASS => 'RT::CustomFieldValues::Groups'; - -my $q = new( RT::Queue ); -isa_ok( $q, 'RT::Queue' ); -my ($qid) = $q->Create( Name => "CF-External-". $$ ); -ok( $qid, "created queue" ); -my %arg = ( Name => $q->Name, - Type => 'Select', - Queue => $q->id, - MaxValues => 1, - ValuesClass => VALUES_CLASS ); - -my $cf = new( RT::CustomField ); -isa_ok( $cf, 'RT::CustomField' ); - -{ - my ($cfid) = $cf->Create( %arg ); - ok( $cfid, "created cf" ); - is( $cf->ValuesClass, VALUES_CLASS, "right values class" ); - ok( $cf->IsExternalValues, "custom field has external values" ); -} - -{ - # create at least on group for the tests - my $group = RT::Group->new( $RT::SystemUser ); - my ($ret, $msg) = $group->CreateUserDefinedGroup( Name => $q->Name ); - ok $ret, 'created group' or diag "error: $msg"; -} - -{ - my $values = $cf->Values; - isa_ok( $values, VALUES_CLASS ); - ok( $values->Count, "we have values" ); - my ($failure, $count) = (0, 0); - while( my $value = $values->Next ) { - $count++; - $failure = 1 unless $value->Name; - } - ok( !$failure, "all values have name" ); - is( $values->Count, $count, "count is correct" ); -} - -exit(0); |