6 use RT::Test tests => 7;
9 my $uri = RT::URI::a->new($RT::SystemUser);
10 ok(ref($uri), "URI object exists");
12 my $class = RT::Class->new( $RT::SystemUser );
13 $class->Create( Name => 'URItest - '. $$ );
14 ok $class->id, 'created a class';
15 my $article = RT::Article->new( $RT::SystemUser );
16 my ($id, $msg) = $article->Create(
17 Name => 'Testing URI parsing - '. $$,
18 Summary => 'In which this should load',
23 my $uristr = "a:" . $article->Id;
24 $uri->ParseURI($uristr);
25 is(ref($uri->Object), "RT::Article", "Object loaded is an article");
26 is($uri->Object->Id, $article->Id, "Object loaded has correct ID");
27 is($article->URI, 'fsck.com-article://example.com/article/'.$article->Id,
28 "URI object has correct URI string");