summaryrefslogtreecommitdiff
path: root/rt/t/articles/uri-a.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-04-24 11:35:56 -0700
committerIvan Kohler <ivan@freeside.biz>2012-04-24 11:35:56 -0700
commit6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch)
treeec77342668e8865aca669c9b4736e84e3077b523 /rt/t/articles/uri-a.t
parent47153aae5c2fc00316654e7277fccd45f72ff611 (diff)
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/t/articles/uri-a.t')
-rw-r--r--rt/t/articles/uri-a.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/rt/t/articles/uri-a.t b/rt/t/articles/uri-a.t
new file mode 100644
index 000000000..82d0f1b01
--- /dev/null
+++ b/rt/t/articles/uri-a.t
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use RT::Test tests => 7;
+
+use_ok("RT::URI::a");
+my $uri = RT::URI::a->new($RT::SystemUser);
+ok(ref($uri), "URI object exists");
+
+my $class = RT::Class->new( $RT::SystemUser );
+$class->Create( Name => 'URItest - '. $$ );
+ok $class->id, 'created a class';
+my $article = RT::Article->new( $RT::SystemUser );
+my ($id, $msg) = $article->Create(
+ Name => 'Testing URI parsing - '. $$,
+ Summary => 'In which this should load',
+ Class => $class->Id
+);
+ok($id,$msg);
+
+my $uristr = "a:" . $article->Id;
+$uri->ParseURI($uristr);
+is(ref($uri->Object), "RT::Article", "Object loaded is an article");
+is($uri->Object->Id, $article->Id, "Object loaded has correct ID");
+is($article->URI, 'fsck.com-article://example.com/article/'.$article->Id,
+ "URI object has correct URI string");