Bugzilla – Attachment 165613 Details for
Bug 32435
Add resolution types to catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32435: Unit tests for Ticket/Ticket::Update change
Bug-32435-Unit-tests-for-TicketTicketUpdate-change.patch (text/plain), 4.85 KB, created by
Marcel de Rooy
on 2024-04-26 07:19:05 UTC
(
hide
)
Description:
Bug 32435: Unit tests for Ticket/Ticket::Update change
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-26 07:19:05 UTC
Size:
4.85 KB
patch
obsolete
>From f9a65847d01f49f3ea4d4bb57e9fd05625292303 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Apr 2024 16:58:34 +0100 >Subject: [PATCH] Bug 32435: Unit tests for Ticket/Ticket::Update change >Content-Type: text/plain; charset=utf-8 > >We add a fallback to allow TICKET_RESOLUTIONS to be returned in the >strings_map as additional TICKET_STATUS states. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Ticket.t | 33 ++++++++++++++++++++++++++++- > t/db_dependent/Koha/Ticket/Update.t | 33 ++++++++++++++++++++++++++++- > 2 files changed, 64 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Ticket.t b/t/db_dependent/Koha/Ticket.t >index 51c862ff77..26f770b912 100755 >--- a/t/db_dependent/Koha/Ticket.t >+++ b/t/db_dependent/Koha/Ticket.t >@@ -229,7 +229,7 @@ subtest 'store() tests' => sub { > }; > > subtest 'strings_map() tests' => sub { >- plan tests => 8; >+ plan tests => 16; > > $schema->storage->txn_begin; > >@@ -264,5 +264,36 @@ subtest 'strings_map() tests' => sub { > is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); > is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); > >+ my $resolution_av = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { >+ authorised_value => 'RES_TEST', >+ category => 'TICKET_RESOLUTION', >+ lib => 'internal resolution description', >+ lib_opac => 'public resolution description', >+ } >+ } >+ ); >+ >+ $ticket = $builder->build_object( >+ { >+ class => 'Koha::Tickets', >+ value => { status => 'RES_TEST' } >+ } >+ ); >+ >+ $strings = $ticket->strings_map(); >+ ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough" ); >+ is( $strings->{status}->{str}, $resolution_av->lib, "'str' set to av->lib" ); >+ is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); >+ is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); >+ >+ $strings = $ticket->strings_map( { public => 1 } ); >+ ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough when called in public" ); >+ is( $strings->{status}->{str}, $resolution_av->lib_opac, "'str' set to av->lib_opac when called in public" ); >+ is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); >+ is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); >+ > $schema->storage->txn_rollback; > }; >diff --git a/t/db_dependent/Koha/Ticket/Update.t b/t/db_dependent/Koha/Ticket/Update.t >index 5b3fc8bc82..bf2582b4a6 100755 >--- a/t/db_dependent/Koha/Ticket/Update.t >+++ b/t/db_dependent/Koha/Ticket/Update.t >@@ -74,7 +74,7 @@ subtest 'user() tests' => sub { > }; > > subtest 'strings_map() tests' => sub { >- plan tests => 8; >+ plan tests => 16; > > $schema->storage->txn_begin; > >@@ -109,5 +109,36 @@ subtest 'strings_map() tests' => sub { > is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); > is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); > >+ my $resolution_av = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { >+ authorised_value => 'RES_TEST', >+ category => 'TICKET_RESOLUTION', >+ lib => 'internal resolution description', >+ lib_opac => 'public resolution description', >+ } >+ } >+ ); >+ >+ $ticket_update = $builder->build_object( >+ { >+ class => 'Koha::Ticket::Updates', >+ value => { status => 'RES_TEST' } >+ } >+ ); >+ >+ $strings = $ticket_update->strings_map(); >+ ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough" ); >+ is( $strings->{status}->{str}, $resolution_av->lib, "'str' set to av->lib" ); >+ is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); >+ is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); >+ >+ $strings = $ticket_update->strings_map( { public => 1 } ); >+ ok( exists $strings->{status}, "'status' entry exists for resolution fallthrough when called in public" ); >+ is( $strings->{status}->{str}, $resolution_av->lib_opac, "'str' set to av->lib_opac when called in public" ); >+ is( $strings->{status}->{type}, 'av', "'type' is 'av'" ); >+ is( $strings->{status}->{category}, 'TICKET_STATUS', "'category' exists and set to 'TICKET_STATUS'" ); >+ > $schema->storage->txn_rollback; > }; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32435
:
160211
|
160212
|
160213
|
160214
|
160260
|
160261
|
160291
|
160292
|
160306
|
160321
|
160322
|
162493
|
164919
|
164920
|
164921
|
164922
|
165558
|
165559
|
165565
|
165566
|
165567
|
165611
|
165612
|
165613
|
165656
|
165657
|
165658
|
165781
|
165782
|
165783