Implemented the last few tests to give Session::Style 100% coverage.

There are still a few functional tests that need to be written, they're
codified as TODOs.

In Session/Style.pm, in all methods that have a send immediate option
(when sent=1), they no longer send and cache.  This prevents duplicate
heag tags from being generated if generateAdditionalHeadTags was
ever called twice.
This commit is contained in:
Colin Kuskie 2006-10-12 22:43:33 +00:00
parent 45627b37ed
commit eadb9ada36
2 changed files with 59 additions and 13 deletions

View file

@ -280,8 +280,12 @@ sub setLink {
$tag .= ' '.$name.'="'.$params->{$name}.'"';
}
$tag .= ' />'."\n";
$self->{_link}{$url} = $tag;
$self->session->output->print($tag) if ($self->sent);
if ($self->sent) {
$self->session->output->print($tag);
}
else {
$self->{_link}{$url} = $tag;
}
}
#-------------------------------------------------------------------
@ -350,8 +354,12 @@ A raw string containing tags. This is just a raw string so you must actually pas
sub setRawHeadTags {
my $self = shift;
my $tags = shift;
$self->{_raw} .= $tags;
$self->session->output->print($tags) if ($self->sent);
if ($self->sent) {
$self->session->output->print($tags);
}
else {
$self->{_raw} .= $tags;
}
}
@ -386,8 +394,12 @@ sub setScript {
$tag .= ' '.$name.'="'.$params->{$name}.'"';
}
$tag .= '></script>'."\n";
$self->{_javascript}{$url} = $tag;
$self->session->output->print($tag) if ($self->sent);
if ($self->sent) {
$self->session->output->print($tag);
}
else {
$self->{_javascript}{$url} = $tag;
}
}
#-------------------------------------------------------------------