|
Lines 13-19
use DateTime::Format::MySQL;
Link Here
|
| 13 |
eval {use Test::Deep;}; |
13 |
eval {use Test::Deep;}; |
| 14 |
|
14 |
|
| 15 |
BEGIN { |
15 |
BEGIN { |
| 16 |
use_ok('C4::Koha'); |
16 |
use_ok('C4::Koha', qw( GetAuthorisedValueByCode GetKohaImageurlFromAuthorisedValues GetDailyQuote )); |
| 17 |
use_ok('C4::Members'); |
17 |
use_ok('C4::Members'); |
| 18 |
} |
18 |
} |
| 19 |
|
19 |
|
|
Lines 83-95
SKIP:
Link Here
|
| 83 |
|
83 |
|
| 84 |
# test quote retrieval based on id |
84 |
# test quote retrieval based on id |
| 85 |
|
85 |
|
| 86 |
my $quote = C4::Koha->GetDailyQuote('id'=>3); |
86 |
my $quote = GetDailyQuote('id'=>3); |
| 87 |
cmp_deeply ($quote, $expected_quote, "Got a quote based on id.") or |
87 |
cmp_deeply ($quote, $expected_quote, "Got a quote based on id.") or |
| 88 |
diag('Be sure to run this test on a clean install of sample data.'); |
88 |
diag('Be sure to run this test on a clean install of sample data.'); |
| 89 |
|
89 |
|
| 90 |
# test random quote retrieval |
90 |
# test random quote retrieval |
| 91 |
|
91 |
|
| 92 |
$quote = C4::Koha->GetDailyQuote('random'=>1); |
92 |
$quote = GetDailyQuote('random'=>1); |
| 93 |
ok ($quote, "Got a random quote."); |
93 |
ok ($quote, "Got a random quote."); |
| 94 |
|
94 |
|
| 95 |
# test quote retrieval based on today's date |
95 |
# test quote retrieval based on today's date |
|
Lines 103-109
SKIP:
Link Here
|
| 103 |
|
103 |
|
| 104 |
# $expected_quote->{'timestamp'} = DateTime::Format::MySQL->format_datetime(DateTime->now); # update the timestamp of expected quote data |
104 |
# $expected_quote->{'timestamp'} = DateTime::Format::MySQL->format_datetime(DateTime->now); # update the timestamp of expected quote data |
| 105 |
|
105 |
|
| 106 |
$quote = C4::Koha->GetDailyQuote(); # this is the "default" mode of selection |
106 |
$quote = GetDailyQuote(); # this is the "default" mode of selection |
| 107 |
cmp_deeply ($quote, $expected_quote, "Got a quote based on today's date.") or |
107 |
cmp_deeply ($quote, $expected_quote, "Got a quote based on today's date.") or |
| 108 |
diag('Be sure to run this test on a clean install of sample data.'); |
108 |
diag('Be sure to run this test on a clean install of sample data.'); |
| 109 |
} |
109 |
} |
| 110 |
- |
|
|