Lines 7-12
use Modern::Perl;
Link Here
|
7 |
use C4::Context; |
7 |
use C4::Context; |
8 |
use Koha::DateUtils qw(dt_from_string); |
8 |
use Koha::DateUtils qw(dt_from_string); |
9 |
use Koha::AuthorisedValue; |
9 |
use Koha::AuthorisedValue; |
|
|
10 |
use Koha::AuthorisedValueCategories; |
10 |
|
11 |
|
11 |
use Test::More tests => 9; |
12 |
use Test::More tests => 9; |
12 |
use DateTime::Format::MySQL; |
13 |
use DateTime::Format::MySQL; |
Lines 31-37
subtest 'Authorized Values Tests' => sub {
Link Here
|
31 |
imageurl => 'IMAGEURL' |
32 |
imageurl => 'IMAGEURL' |
32 |
}; |
33 |
}; |
33 |
|
34 |
|
34 |
|
35 |
my $avc = Koha::AuthorisedValueCategories->find($data->{category}); |
|
|
36 |
Koha::AuthorisedValueCategory->new({ category_name => $data->{category} })->store unless $avc; |
35 |
# Insert an entry into authorised_value table |
37 |
# Insert an entry into authorised_value table |
36 |
my $insert_success = Koha::AuthorisedValue->new( |
38 |
my $insert_success = Koha::AuthorisedValue->new( |
37 |
{ category => $data->{category}, |
39 |
{ category => $data->{category}, |
Lines 61-66
subtest 'Authorized Values Tests' => sub {
Link Here
|
61 |
SKIP: { |
63 |
SKIP: { |
62 |
eval { require Test::Deep; import Test::Deep; }; |
64 |
eval { require Test::Deep; import Test::Deep; }; |
63 |
skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; |
65 |
skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; |
|
|
66 |
Koha::AuthorisedValueCategory->new({ category_name => 'BUG10656' })->store; |
64 |
Koha::AuthorisedValue->new( |
67 |
Koha::AuthorisedValue->new( |
65 |
{ category => 'BUG10656', |
68 |
{ category => 'BUG10656', |
66 |
authorised_value => 'ZZZ', |
69 |
authorised_value => 'ZZZ', |
Lines 289-294
subtest 'GetFrameworksLoop() tests' => sub {
Link Here
|
289 |
subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ |
292 |
subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ |
290 |
plan tests => 7; |
293 |
plan tests => 7; |
291 |
|
294 |
|
|
|
295 |
my $avc = Koha::AuthorisedValueCategories->find('ITEMTYPECAT'); |
296 |
Koha::AuthorisedValueCategory->new({ category_name => 'ITEMTYPECAT' })->store unless $avc; |
292 |
my $insertGroup = Koha::AuthorisedValue->new( |
297 |
my $insertGroup = Koha::AuthorisedValue->new( |
293 |
{ category => 'ITEMTYPECAT', |
298 |
{ category => 'ITEMTYPECAT', |
294 |
authorised_value => 'Quertyware', |
299 |
authorised_value => 'Quertyware', |
295 |
- |
|
|