diff options
Diffstat (limited to 'rt/t/articles/uri-articles.t')
-rw-r--r-- | rt/t/articles/uri-articles.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rt/t/articles/uri-articles.t b/rt/t/articles/uri-articles.t new file mode 100644 index 000000000..4124b1942 --- /dev/null +++ b/rt/t/articles/uri-articles.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use RT::Test tests => 9; + +use_ok "RT::URI::fsck_com_article"; +my $uri = RT::URI::fsck_com_article->new( $RT::SystemUser ); + +ok $uri; +isa_ok $uri, 'RT::URI::fsck_com_article'; +isa_ok $uri, 'RT::URI::base'; +isa_ok $uri, 'RT::Base'; + +is $uri->LocalURIPrefix, 'fsck.com-article://example.com/article/'; + +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); + +$uri = RT::URI::fsck_com_article->new( $article->CurrentUser ); +is $uri->LocalURIPrefix . $article->id, $uri->URIForObject( $article ); + |