Skip to content

Commit

Permalink
Item11366: Avoid using Foswiki::Address in test
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@14057 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Feb 22, 2012
1 parent d86af21 commit 59e9418
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions UnitTestContrib/test/unit/FormattingTests.pm
Expand Up @@ -1742,7 +1742,6 @@ sub _check_rendered_linktext {
my $addrObj;
my $part;

require Foswiki::Address;
require HTML::Entities;
print "[[$linktext]]\n\t$html\n" if TRACE;
$this->assert( $html !~ $editpathregex,
Expand All @@ -1764,27 +1763,20 @@ sub _check_rendered_linktext {
else {
$expectedAddress = "$this->{test_web}.$this->{test_topic}";
}
$addrObj = Foswiki::Address->new(
string => $address,
web => $this->{test_web},
topic => $this->{test_topic},
isA => 'topic'
);
$expectedAddrObj = Foswiki::Address->new(
string => $expectedAddress,
web => $this->{test_web},
topic => $this->{test_topic},
isA => 'topic'
);
my ( $actualWeb, $actualTopic ) =
Foswiki::Func::normalizeWebTopicName( $this->{test_web}, $address );
my ( $expectedWeb, $expectedTopic ) =
Foswiki::Func::normalizeWebTopicName( $this->{test_web},
$expectedAddress );
print "\tfrag: "
. ( defined $fragment ? $fragment : 'undef' )
. ",\tquery: "
. ( defined $query ? $query : 'undef' )
. ",\taddr: "
. ( defined $address ? $address : 'undef' ) . "\n"
if TRACE;
$this->assert_str_equals( $expectedAddrObj->stringify(),
$addrObj->stringify(), "address mismatch checking [[$linktext]]" );
$this->assert_str_equals( "$expectedWeb.$expectedTopic",
"$actualWeb.$actualTopic", "address mismatch checking [[$linktext]]" );
$this->assert_deep_equals( $expected->{query}, $query,
"query mismatch checking [[$linktext]]" );
$this->assert_deep_equals( $expected->{fragment}, $fragment,
Expand Down

0 comments on commit 59e9418

Please sign in to comment.