|
Lines 74-80
subtest 'user() tests' => sub {
Link Here
|
| 74 |
}; |
74 |
}; |
| 75 |
|
75 |
|
| 76 |
subtest 'strings_map() tests' => sub { |
76 |
subtest 'strings_map() tests' => sub { |
| 77 |
plan tests => 8; |
77 |
plan tests => 16; |
| 78 |
|
78 |
|
| 79 |
$schema->storage->txn_begin; |
79 |
$schema->storage->txn_begin; |
| 80 |
|
80 |
|
|
Lines 109-113
subtest 'strings_map() tests' => sub {
Link Here
|
| 109 |
is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); |
109 |
is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); |
| 110 |
is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); |
110 |
is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); |
| 111 |
|
111 |
|
|
|
112 |
my $resolution_av = $builder->build_object( |
| 113 |
{ |
| 114 |
class => 'Koha::AuthorisedValues', |
| 115 |
value => { |
| 116 |
authorised_value => 'RES_TEST', |
| 117 |
category => 'TICKET_RESOLUTION', |
| 118 |
lib => 'internal resolution description', |
| 119 |
lib_opac => 'public resolution description', |
| 120 |
} |
| 121 |
} |
| 122 |
); |
| 123 |
|
| 124 |
$ticket_update = $builder->build_object( |
| 125 |
{ |
| 126 |
class => 'Koha::Ticket::Updates', |
| 127 |
value => { status => 'RES_TEST' } |
| 128 |
} |
| 129 |
); |
| 130 |
|
| 131 |
$strings = $ticket_update->strings_map(); |
| 132 |
ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough" ); |
| 133 |
is( $strings->{status}->{str}, $resolution_av->lib, "'str' set to av->lib" ); |
| 134 |
is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); |
| 135 |
is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); |
| 136 |
|
| 137 |
$strings = $ticket_update->strings_map( { public => 1 } ); |
| 138 |
ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough when called in public" ); |
| 139 |
is( $strings->{status}->{str}, $resolution_av->lib_opac, "'str' set to av->lib_opac when called in public" ); |
| 140 |
is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); |
| 141 |
is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); |
| 142 |
|
| 112 |
$schema->storage->txn_rollback; |
143 |
$schema->storage->txn_rollback; |
| 113 |
}; |
144 |
}; |
| 114 |
- |
|
|