|
Lines 8-14
use warnings;
Link Here
|
| 8 |
use C4::Context; |
8 |
use C4::Context; |
| 9 |
use Koha::DateUtils qw(dt_from_string); |
9 |
use Koha::DateUtils qw(dt_from_string); |
| 10 |
|
10 |
|
| 11 |
use Test::More tests => 9; |
11 |
use Test::More tests => 10; |
| 12 |
use DateTime::Format::MySQL; |
12 |
use DateTime::Format::MySQL; |
| 13 |
|
13 |
|
| 14 |
BEGIN { |
14 |
BEGIN { |
|
Lines 147-166
subtest 'Itemtype info Tests' => sub {
Link Here
|
| 147 |
like ( getitemtypeinfo('BK', 'opac')->{'imageurl'}, qr/opac-tmpl/, 'getitemtypeinfo on "opac" interface returns opac imageurl' ); |
147 |
like ( getitemtypeinfo('BK', 'opac')->{'imageurl'}, qr/opac-tmpl/, 'getitemtypeinfo on "opac" interface returns opac imageurl' ); |
| 148 |
}; |
148 |
}; |
| 149 |
|
149 |
|
| 150 |
|
|
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
### test for C4::Koha->GetDailyQuote() |
150 |
### test for C4::Koha->GetDailyQuote() |
| 165 |
SKIP: |
151 |
SKIP: |
| 166 |
{ |
152 |
{ |
|
Lines 353-356
subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{
Link Here
|
| 353 |
@expected = ( 'BKghjklo1', 'Qwertyware', 'Veryheavybook' ); |
339 |
@expected = ( 'BKghjklo1', 'Qwertyware', 'Veryheavybook' ); |
| 354 |
is_deeply(\@results,\@expected, 'GetItemTypesCategorized: grouped and ungrouped items returned as expected.'); |
340 |
is_deeply(\@results,\@expected, 'GetItemTypesCategorized: grouped and ungrouped items returned as expected.'); |
| 355 |
}; |
341 |
}; |
|
|
342 |
|
| 343 |
subtest 'GetItemTypes test' => sub { |
| 344 |
plan tests => 1; |
| 345 |
$dbh->do(q|DELETE FROM itemtypes|); |
| 346 |
$dbh->do(q|INSERT INTO itemtypes(itemtype, description) VALUES ('a', 'aa desc'), ('b', 'zz desc'), ('d', 'dd desc'), ('c', 'yy desc')|); |
| 347 |
my $itemtypes = C4::Koha::GetItemTypes( style => 'array' ); |
| 348 |
$itemtypes = [ map { $_->{itemtype} } @$itemtypes ]; |
| 349 |
is_deeply( $itemtypes, [ 'a', 'd', 'c', 'b' ], 'GetItemTypes(array) should return itemtypes ordered by description'); |
| 350 |
}; |
| 351 |
|
| 356 |
$dbh->rollback(); |
352 |
$dbh->rollback(); |
| 357 |
- |
|
|