|
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 70-75
subtest 'Authorized Values Tests' => sub {
Link Here
|
| 70 |
SKIP: { |
72 |
SKIP: { |
| 71 |
eval { require Test::Deep; import Test::Deep; }; |
73 |
eval { require Test::Deep; import Test::Deep; }; |
| 72 |
skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; |
74 |
skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; |
|
|
75 |
Koha::AuthorisedValueCategory->new({ category_name => 'BUG10656' })->store; |
| 73 |
Koha::AuthorisedValue->new( |
76 |
Koha::AuthorisedValue->new( |
| 74 |
{ category => 'BUG10656', |
77 |
{ category => 'BUG10656', |
| 75 |
authorised_value => 'ZZZ', |
78 |
authorised_value => 'ZZZ', |
|
Lines 298-303
subtest 'GetFrameworksLoop() tests' => sub {
Link Here
|
| 298 |
subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ |
301 |
subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ |
| 299 |
plan tests => 7; |
302 |
plan tests => 7; |
| 300 |
|
303 |
|
|
|
304 |
my $avc = Koha::AuthorisedValueCategories->find('ITEMTYPECAT'); |
| 305 |
Koha::AuthorisedValueCategory->new({ category_name => 'ITEMTYPECAT' })->store unless $avc; |
| 301 |
my $insertGroup = Koha::AuthorisedValue->new( |
306 |
my $insertGroup = Koha::AuthorisedValue->new( |
| 302 |
{ category => 'ITEMTYPECAT', |
307 |
{ category => 'ITEMTYPECAT', |
| 303 |
authorised_value => 'Quertyware', |
308 |
authorised_value => 'Quertyware', |
| 304 |
- |
|
|