3 use RT::Test tests => undef;
6 local $SIG{__WARN__} = sub {
11 my $ticket = RT::Test->create_ticket( Queue => 1, Subject => 'test ticket' );
12 ok $ticket->id, 'created ticket';
14 # Create article class
15 my $class = RT::Class->new( $RT::SystemUser );
16 $class->Create( Name => 'URItest - '. $$ );
17 ok $class->id, 'created a class';
20 my $article = RT::Article->new( $RT::SystemUser );
22 Name => 'Testing URI parsing - '. $$,
23 Summary => 'In which this should load',
26 ok $article->id, 'create article';
28 # Test permutations of URIs
29 my $ORG = RT->Config->Get('Organization');
30 my $URI = RT::URI->new( RT->SystemUser );
33 "1" => "fsck.com-rt://$ORG/ticket/1",
34 "t:1" => "fsck.com-rt://$ORG/ticket/1",
35 "fsck.com-rt://$ORG/ticket/1" => "fsck.com-rt://$ORG/ticket/1",
38 "a:1" => "fsck.com-article://$ORG/article/1",
39 "fsck.com-article://$ORG/article/1" => "fsck.com-article://$ORG/article/1",
42 "http://$ORG" => "http://$ORG",
43 "mailto:foo\@example.com" => "mailto:foo\@example.com",
44 "invalid" => "invalid", # doesn't trigger die
46 for my $uri (sort keys %expected) {
47 is $URI->CanonicalizeURI($uri), $expected{$uri}, "canonicalized as expected";
50 is_deeply \@warnings, [
51 "Could not determine a URI scheme for invalid\n",
52 ], "expected warnings";