Bugzilla – Attachment 80439 Details for
Bug 21503
Update AuthorisedValues.pm to fall back to code if description doesn't exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21503: Tests for the exiting behavior
Bug-21503-Tests-for-the-exiting-behavior.patch (text/plain), 3.65 KB, created by
Christopher Brannon
on 2018-10-11 22:28:24 UTC
(
hide
)
Description:
Bug 21503: Tests for the exiting behavior
Filename:
MIME Type:
Creator:
Christopher Brannon
Created:
2018-10-11 22:28:24 UTC
Size:
3.65 KB
patch
obsolete
>From 72e37fab5d0ba74261473e199381a5837704c677 Mon Sep 17 00:00:00 2001 >From: Christopher Brannon <cbrannon@cdalibrary.org> >Date: Thu, 11 Oct 2018 22:25:31 +0000 >Subject: [PATCH] Bug 21503: Tests for the exiting behavior > >--- > t/db_dependent/Template/Plugin/AuthorisedValues.t | 33 +++++++++++++++-------- > 1 file changed, 22 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Template/Plugin/AuthorisedValues.t b/t/db_dependent/Template/Plugin/AuthorisedValues.t >index bd3c95d6b7..c5b10de44d 100644 >--- a/t/db_dependent/Template/Plugin/AuthorisedValues.t >+++ b/t/db_dependent/Template/Plugin/AuthorisedValues.t >@@ -73,7 +73,7 @@ subtest 'GetByCode' => sub { > > subtest 'GetDescriptionByKohaField' => sub { > >- plan tests => 4; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -110,24 +110,35 @@ subtest 'GetDescriptionByKohaField' => sub { > ); > my $av_2 = $builder->build_object( > { class => 'Koha::AuthorisedValues', >- value => { category => $avc->category_name, lib_opac => undef, lib => undef } >+ value => { category => $avc->category_name, lib_opac => undef, lib => 'lib' } >+ } >+ ); >+ my $av_3 = $builder->build_object( >+ { class => 'Koha::AuthorisedValues', >+ value => { category => $avc->category_name, lib_opac =>undef, lib => undef } > } > ); >- my $non_existent_av = $av_2->authorised_value; >- $av_2->delete; >+ my $non_existent_av = $av_3->authorised_value; >+ $av_3->delete; > > my $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( > { opac => 1, kohafield => 'dummy.field', authorised_value => $av_1->authorised_value } ); >- is( $av, 'lib_opac', 'We requested an existing AV description, for the OPAC' ); >- >+ is( $av, 'lib_opac', 'We requested an existing AV description for the OPAC' ); > $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( >- { kohafield => 'dummy.field', authorised_value => $av_1->authorised_value } ); >- is( $av, 'lib', 'We requested an existing AV description, not for the OPAC' ); >- >+ { opac => 1, kohafield => 'dummy.field', authorised_value => $av_2->authorised_value } ); >+ is( $av, 'lib', 'We requested an OPAC AV description for the OPAC, return a regular description' ); >+ $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( >+ { opac => 1, kohafield => 'dummy.field', authorised_value => $av_3->authorised_value } ); >+ is( $av, $av_3->authorised_value, 'We requested an non-existing OPAC AV description for the OPAC, return the authorised_value.' ); > $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( > { opac => 1, kohafield => 'dummy.field', authorised_value => $non_existent_av } ); >- is( $av, '', 'We requested a non existing AV description, for the OPAC, return empty string' ); >- >+ is( $av, '', 'We requested a non existing AV description for the OPAC, return empty string' ); >+ $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( >+ { kohafield => 'dummy.field', authorised_value => $av_1->authorised_value } ); >+ is( $av, 'lib', 'We requested an existing AV regular description.' ); >+ $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( >+ { kohafield => 'dummy.field', authorised_value => $av_1->authorised_value } ); >+ is( $av, $av_3->authorised_value, 'We requested an non-existing AV regular description, return the authorised_value.' ); > $av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( > { kohafield => 'dummy.field', authorised_value => $non_existent_av } ); > is( $av, '', >-- >2.11.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 21503
:
80151
|
80152
|
80233
|
80439
|
80521
|
80544
|
80545
|
80558
|
80561
|
80562
|
80563
|
80601
|
80758
|
80759
|
80762
|
101323
|
101324
|
101325
|
101326
|
101327
|
101328
|
101524
|
101525
|
101526
|
101527
|
101528
|
101529
|
101533
|
101534
|
101535