Bugzilla – Attachment 165631 Details for
Bug 35628
Add optional statuses to catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35628: Add unit tests for Koha::Ticket::Update addition
Bug-35628-Add-unit-tests-for-KohaTicketUpdate-addi.patch (text/plain), 2.47 KB, created by
Martin Renvoize (ashimema)
on 2024-04-26 09:37:08 UTC
(
hide
)
Description:
Bug 35628: Add unit tests for Koha::Ticket::Update addition
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-26 09:37:08 UTC
Size:
2.47 KB
patch
obsolete
>From 16377239d999916adf1a59cb65a60b9fdf27cd6a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Apr 2024 16:51:09 +0100 >Subject: [PATCH] Bug 35628: Add unit tests for Koha::Ticket::Update addition > >We add a strings_map method to Koha::Ticket::Update and thus need >to have corresponding unit tests. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Ticket/Update.t | 41 ++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Ticket/Update.t b/t/db_dependent/Koha/Ticket/Update.t >index 8c357aef783..5b3fc8bc828 100755 >--- a/t/db_dependent/Koha/Ticket/Update.t >+++ b/t/db_dependent/Koha/Ticket/Update.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > use t::lib::TestBuilder; > > use Koha::Database; >@@ -72,3 +72,42 @@ subtest 'user() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'strings_map() tests' => sub { >+ plan tests => 8; >+ >+ $schema->storage->txn_begin; >+ >+ my $status_av = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { >+ authorised_value => 'TEST', >+ category => 'TICKET_STATUS', >+ lib => 'internal description', >+ lib_opac => 'public description', >+ } >+ } >+ ); >+ >+ my $ticket_update = $builder->build_object( >+ { >+ class => 'Koha::Ticket::Updates', >+ value => { status => 'TEST' } >+ } >+ ); >+ >+ my $strings = $ticket_update->strings_map(); >+ ok( exists $strings->{status}, "'status' entry exists" ); >+ is( $strings->{status}->{str}, $status_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 when called in public" ); >+ is( $strings->{status}->{str}, $status_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.44.0
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 35628
:
160255
|
160256
|
160257
|
160258
|
160259
|
160268
|
160269
|
160270
|
160271
|
160272
|
160273
|
160274
|
160286
|
160287
|
160288
|
160289
|
160290
|
160308
|
160309
|
160310
|
160311
|
160312
|
160313
|
160314
|
160315
|
160316
|
160317
|
160318
|
160319
|
160320
|
160329
|
160330
|
160331
|
160332
|
160333
|
160334
|
160335
|
160364
|
162500
|
164912
|
164913
|
164914
|
164915
|
164916
|
164917
|
164918
|
165551
|
165552
|
165553
|
165554
|
165555
|
165556
|
165557
|
165560
|
165561
|
165562
|
165563
|
165564
|
165599
|
165600
|
165601
|
165602
|
165603
|
165604
|
165605
|
165606
|
165607
|
165608
|
165622
|
165623
|
165624
|
165625
|
165626
|
165627
|
165628
|
165629
|
165630
|
165631
|
165770
|
165771
|
165772
|
165773
|
165774
|
165775
|
165776
|
165777
|
165778
|
165779