diff options
author | cvs2git <cvs2git> | 2011-02-17 00:25:24 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2011-02-17 00:25:24 +0000 |
commit | 52bb24a1bc7d80a768639a4b04c471553078502b (patch) | |
tree | 2eb640a577bbbae345e98bbac400e6f07fcb6d8a /rt/lib/t/regression/13-attribute-tests.t | |
parent | fc6209f398899f0211cfcedeb81a3cd65e04a941 (diff) |
This commit was manufactured by cvs2svn to create tag 'RT_3_8_9'.RT_3_8_9
Diffstat (limited to 'rt/lib/t/regression/13-attribute-tests.t')
-rw-r--r-- | rt/lib/t/regression/13-attribute-tests.t | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/rt/lib/t/regression/13-attribute-tests.t b/rt/lib/t/regression/13-attribute-tests.t deleted file mode 100644 index fdac94e..0000000 --- a/rt/lib/t/regression/13-attribute-tests.t +++ /dev/null @@ -1,87 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 34; -use RT; -RT::LoadConfig(); -RT::Init(); - - -my $runid = rand(200); - -my $attribute = "squelch-$runid"; - -ok(require RT::Attributes); - -my $user = RT::User->new($RT::SystemUser); -ok (UNIVERSAL::isa($user, 'RT::User')); -my ($id,$msg) = $user->Create(Name => 'attrtest-'.$runid); -ok ($id, $msg); -ok($user->id, "Created a test user"); - -ok(1, $user->Attributes->BuildSelectQuery); -my $attr = $user->Attributes; -# XXX: Order by id as some tests depend on it -$attr->OrderByCols({ FIELD => 'id' }); - -ok(1, $attr->BuildSelectQuery); - - -ok (UNIVERSAL::isa($attr,'RT::Attributes'), 'got the attributes object'); - -($id, $msg) = $user->AddAttribute(Name => 'TestAttr', Content => 'The attribute has content'); -ok ($id, $msg); -is ($attr->Count,1, " One attr after adidng a first one"); - -my $first_attr = $user->FirstAttribute('TestAttr'); -ok($first_attr, "got some sort of attribute"); -isa_ok($first_attr, 'RT::Attribute'); -is($first_attr->Content, 'The attribute has content', "got the right content back"); - -($id, $msg) = $attr->DeleteEntry(Name => $runid); -ok(!$id, "Deleted non-existant entry - $msg"); -is ($attr->Count,1, "1 attr after deleting an empty attr"); - -my @names = $attr->Names; -is ("@names", "TestAttr"); - - -($id, $msg) = $user->AddAttribute(Name => $runid, Content => "First"); -ok($id, $msg); - -my $runid_attr = $user->FirstAttribute($runid); -ok($runid_attr, "got some sort of attribute"); -isa_ok($runid_attr, 'RT::Attribute'); -is($runid_attr->Content, 'First', "got the right content back"); - -is ($attr->Count,2, " Two attrs after adding an attribute named $runid"); -($id, $msg) = $user->AddAttribute(Name => $runid, Content => "Second"); -ok($id, $msg); - -$runid_attr = $user->FirstAttribute($runid); -ok($runid_attr, "got some sort of attribute"); -isa_ok($runid_attr, 'RT::Attribute'); -is($runid_attr->Content, 'First', "got the first content back still"); - -is ($attr->Count,3, " Three attrs after adding a secondvalue to $runid"); -($id, $msg) = $attr->DeleteEntry(Name => $runid, Content => "First"); -ok($id, $msg); -is ($attr->Count,2); - -#$attr->_DoSearch(); -($id, $msg) = $attr->DeleteEntry(Name => $runid, Content => "Second"); -ok($id, $msg); -is ($attr->Count,1); - -#$attr->_DoSearch(); -ok(1, $attr->BuildSelectQuery); -($id, $msg) = $attr->DeleteEntry(Name => "moose"); -ok(!$id, "Deleted non-existant entry - $msg"); -is ($attr->Count,1); - -ok(1, $attr->BuildSelectQuery); -@names = $attr->Names; -is("@names", "TestAttr"); - - - -1; |