Bugzilla – Attachment 125863 Details for
Bug 27526
Remove Mod/AddItemFromMarc from additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27526: Improve robustness of tests
Bug-27526-Improve-robustness-of-tests.patch (text/plain), 2.07 KB, created by
Jonathan Druart
on 2021-10-07 08:54:37 UTC
(
hide
)
Description:
Bug 27526: Improve robustness of tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-07 08:54:37 UTC
Size:
2.07 KB
patch
obsolete
>From 42a1b3ffef7f8aae05718aa3a8676452364b923e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Oct 2021 15:45:17 +0200 >Subject: [PATCH] Bug 27526: Improve robustness of tests > >* Could fail if not using the original sample data: build the AV we need >instead of relying on what is in the DB >--- > t/db_dependent/Koha/Item.t | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index b791646b40a..1625e0132c6 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1103,7 +1103,7 @@ subtest 'columns_to_str' => sub { > > my $biblio = $builder->build_sample_biblio({ frameworkcode => '' }); > my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >- my $itemlost = Koha::AuthorisedValues->search({ category => 'LOST' })->next->authorised_value; >+ my $lost_av = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => 'LOST', authorised_value => '42' }}); > my $dateaccessioned = '2020-12-15'; > my $library = Koha::Libraries->search->next; > my $branchcode = $library->branchcode; >@@ -1126,7 +1126,7 @@ subtest 'columns_to_str' => sub { > > $item->update( > { >- itemlost => $itemlost, >+ itemlost => $lost_av->authorised_value, > dateaccessioned => $dateaccessioned, > more_subfields_xml => $some_marc_xml, > } >@@ -1135,9 +1135,9 @@ subtest 'columns_to_str' => sub { > $item = $item->get_from_storage; > > my $s = $item->columns_to_str; >- is( $s->{itemlost}, 'Lost' ); >- is( $s->{dateaccessioned}, '2020-12-15'); >- is( $s->{'é'}, 'value é'); >+ is( $s->{itemlost}, $lost_av->lib, 'Attributes linked with AV replaced with description' ); >+ is( $s->{dateaccessioned}, '2020-12-15', 'Date attributes iso formatted'); >+ is( $s->{'é'}, 'value é', 'subfield ok with more than a-Z'); > is( $s->{'è'}, $library->branchname ); > > $cache->clear_from_cache("MarcStructure-0-"); >-- >2.25.1
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 27526
:
115679
|
115680
|
116006
|
117806
|
117807
|
117808
|
121589
|
121590
|
121591
|
122288
|
122318
|
122655
|
122656
|
122657
|
122658
|
122676
|
122677
|
122681
|
122682
|
122694
|
122695
|
122696
|
122946
|
122947
|
122948
|
122949
|
122950
|
122951
|
122952
|
122953
|
122954
|
122957
|
122958
|
122959
|
122974
|
123006
|
123007
|
123110
|
123329
|
123372
|
123415
|
123757
|
123758
|
123759
|
123760
|
123761
|
123762
|
123763
|
123764
|
123765
|
123766
|
123767
|
123768
|
123769
|
123770
|
123771
|
123772
|
125069
|
125605
|
125606
|
125607
|
125608
|
125609
|
125610
|
125611
|
125612
|
125613
|
125614
|
125615
|
125616
|
125617
|
125618
|
125619
|
125620
|
125818
|
125839
| 125863 |
126034
|
126051
|
126143
|
126144
|
126393
|
127025
|
127032