Lines 33-39
my $builder = t::lib::TestBuilder->new;
Link Here
|
33 |
$schema->storage->txn_begin; |
33 |
$schema->storage->txn_begin; |
34 |
|
34 |
|
35 |
subtest 'get' => sub { |
35 |
subtest 'get' => sub { |
36 |
plan tests => 2; |
36 |
plan tests => 4; |
37 |
|
37 |
|
38 |
my $additional_contents = Koha::Template::Plugin::AdditionalContents->get({ category => 'news', location => ['opac_only', 'staff_and_opac'], lang => 'default', library => '%' }); |
38 |
my $additional_contents = Koha::Template::Plugin::AdditionalContents->get({ category => 'news', location => ['opac_only', 'staff_and_opac'], lang => 'default', library => '%' }); |
39 |
my $before_count = $additional_contents ? $additional_contents->{content}->count() : 0; |
39 |
my $before_count = $additional_contents ? $additional_contents->{content}->count() : 0; |
Lines 61-66
subtest 'get' => sub {
Link Here
|
61 |
|
61 |
|
62 |
is( $additional_contents->{blocktitle}, 'blockhead', "Block title is passed through"); |
62 |
is( $additional_contents->{blocktitle}, 'blockhead', "Block title is passed through"); |
63 |
|
63 |
|
|
|
64 |
$additional_contents = Koha::Template::Plugin::AdditionalContents->get({ id => $additional_content->id, category => 'news', location => ['opac_only', 'staff_and_opac'], lang => 'default' }); |
65 |
is( $additional_contents->{content}->count, 1 ); |
66 |
|
67 |
$additional_contents = Koha::Template::Plugin::AdditionalContents->get({ id => $additional_content->id, category => 'html_customizations', location => ['opac_only', 'staff_and_opac'], lang => 'default' }); |
68 |
is( $additional_contents, undef ); |
64 |
|
69 |
|
65 |
}; |
70 |
}; |
66 |
|
71 |
|
67 |
- |
|
|