Lines 1-5
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
|
|
3 |
# This file is part of Koha |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it |
6 |
# under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 3 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but |
11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
3 |
use Modern::Perl; |
18 |
use Modern::Perl; |
4 |
use Test::More; |
19 |
use Test::More; |
5 |
use Test::More tests => 3; |
20 |
use Test::More tests => 3; |
Lines 34-40
my $expected_quote = {
Link Here
|
34 |
text => 'Unfurl thy limbs breathless succubus<br/>How the full embosomed fog<br/>Imparts the night to us....', |
49 |
text => 'Unfurl thy limbs breathless succubus<br/>How the full embosomed fog<br/>Imparts the night to us....', |
35 |
}; |
50 |
}; |
36 |
|
51 |
|
37 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', ''); |
52 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', 0); |
38 |
|
53 |
|
39 |
subtest "GetDailyQuoteForInterface" => sub { |
54 |
subtest "GetDailyQuoteForInterface" => sub { |
40 |
|
55 |
|
Lines 48-59
subtest "GetDailyQuoteForInterface" => sub {
Link Here
|
48 |
ok(not($quote), "'QuoteOfTheDay'-syspref not set so nothing returned"); |
63 |
ok(not($quote), "'QuoteOfTheDay'-syspref not set so nothing returned"); |
49 |
|
64 |
|
50 |
##Set 'QuoteOfTheDay'-syspref to not include current interface 'opac' |
65 |
##Set 'QuoteOfTheDay'-syspref to not include current interface 'opac' |
51 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intra commandline sip2 api yo-mama'); |
66 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intranet'); |
52 |
$quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); |
67 |
$quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); |
53 |
ok(not($quote), "'QuoteOfTheDay'-syspref doesn't include 'opac'"); |
68 |
ok(not($quote), "'QuoteOfTheDay'-syspref doesn't include 'opac'"); |
54 |
|
69 |
|
55 |
##Set 'QuoteOfTheDay'-syspref to include current interface 'opac' |
70 |
##Set 'QuoteOfTheDay'-syspref to include current interface 'opac' |
56 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intraopaccommandline'); |
71 |
t::lib::Mocks::mock_preference('QuoteOfTheDay', 'opac,intranet'); |
57 |
$quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); |
72 |
$quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); |
58 |
is($quote->{text}, $expected_quote->{text}, "Got the expected quote"); |
73 |
is($quote->{text}, $expected_quote->{text}, "Got the expected quote"); |
59 |
|
74 |
|
60 |
- |
|
|