Skip to content

Commit

Permalink
Item15227: added unit tests for lateInitPlugin()
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Nov 17, 2023
1 parent 403c80c commit 2edda50
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions UnitTestContrib/test/unit/PluginHandlerTests.pm
Expand Up @@ -411,6 +411,23 @@ HERE
$this->createNewFoswikiSession(); # for tear_down
}

sub test_lateInitPlugin {
my $this = shift;
$this->makePlugin( 'lateInitPlugin', <<'HERE');
sub lateInitPlugin {
# $tester not set up yet
die "LIP $called->{lateInitPlugin} again" if $called->{lateInitPlugin};
die "IP $called->{initPlugin} not called yet" unless $called->{initPlugin};
$called->{lateInitPlugin} = 1;
return undef;
}
HERE
$this->checkCalls( 1, 'lateInitPlugin' );
$this->checkCalls( 1, 'initPlugin' );

return;
}

# Test that the rendering handlers are called in the correct sequence.
# The sequence is:
# 1 startRenderingHandler
Expand Down

0 comments on commit 2edda50

Please sign in to comment.