Skip to content

Commit

Permalink
Item14380: fix unit tests of HomePagePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Feb 28, 2023
1 parent f1b6034 commit 087626c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions HomePagePlugin/test/unit/HomePagePlugin/HomePagePluginSuite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,15 @@ sub test_login {
);
$query->path_info("");
$query->header( 'Host' => 'www.home.org' );
$ENV{HTTP_HOST} = 'www.home.org';

$this->{test_topicObject}->finish() if $this->{test_topicObject};
$this->{session}->finish() if $this->{session};
$this->{session} =
Foswiki->new( $this->{test_user_login}, $query, { login => 1 } );

$this->assert_equals( 'TestTopic',
$Foswiki::Plugins::SESSION->{topicName} );
$this->assert_equals(
'TemporaryHomePagePluginTestWeb',
$Foswiki::Plugins::SESSION->{webName}
);
$this->assert_equals( 'Www', $Foswiki::Plugins::SESSION->{topicName} );
$this->assert_equals( 'Home', $Foswiki::Plugins::SESSION->{webName} );
}

sub test_view {
Expand All @@ -109,18 +106,15 @@ sub test_view {
);
$query->path_info("");
$query->header( 'Host' => 'www.home.org' );
$ENV{HTTP_HOST} = 'www.home.org';

$this->{test_topicObject}->finish() if $this->{test_topicObject};
$this->{session}->finish() if $this->{session};
$this->{session} =
Foswiki->new( $this->{test_user_login}, $query, { view => 1 } );

$this->assert_equals( 'TestTopic',
$Foswiki::Plugins::SESSION->{topicName} );
$this->assert_equals(
'TemporaryHomePagePluginTestWeb',
$Foswiki::Plugins::SESSION->{webName}
);
$this->assert_equals( 'Www', $Foswiki::Plugins::SESSION->{topicName} );
$this->assert_equals( 'Home', $Foswiki::Plugins::SESSION->{webName} );
}

sub test_invalid_redirect {
Expand Down

0 comments on commit 087626c

Please sign in to comment.