Bugzilla – Attachment 85817 Details for
Bug 15774
Additional fields for baskets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15774: Add missing tests for Koha::Object::Mixin::AdditionalFields
Bug-15774-Add-missing-tests-for-KohaObjectMixinAdd.patch (text/plain), 2.79 KB, created by
Josef Moravec
on 2019-02-28 08:07:31 UTC
(
hide
)
Description:
Bug 15774: Add missing tests for Koha::Object::Mixin::AdditionalFields
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-02-28 08:07:31 UTC
Size:
2.79 KB
patch
obsolete
>From e60b3657ccb0da84cd09b355454e1449a436f6f6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 1 Nov 2018 17:54:43 -0300 >Subject: [PATCH] Bug 15774: Add missing tests for > Koha::Object::Mixin::AdditionalFields > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../Koha/Objects/Mixin/AdditionalFields.t | 53 +++++++++++++++++----- > 1 file changed, 42 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t b/t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t >index e06182e4d6..f15225e9f0 100755 >--- a/t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t >+++ b/t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 12; > > use Koha::Acquisition::Baskets; # Koha::Acquisition::Baskets uses the mixin > use Koha::AdditionalFields; >@@ -42,16 +42,47 @@ Koha::AdditionalFieldValue->new({ > record_id => $basket1->basketno, > value => 'bar value for basket1', > })->store; >-Koha::AdditionalFieldValue->new({ >- field_id => $foo->id, >- record_id => $basket2->basketno, >- value => 'foo value for basket2', >-})->store; >-Koha::AdditionalFieldValue->new({ >- field_id => $bar->id, >- record_id => $basket2->basketno, >- value => 'bar value for basket2', >-})->store; >+ >+my $additional_fields_for_basket2 = [ >+ { >+ id => $foo->id, >+ value => 'foo value for basket2', >+ }, >+ { >+ id => $bar->id, >+ value => 'bar value for basket2', >+ }, >+]; >+$basket2->set_additional_fields($additional_fields_for_basket2); >+ >+my $additional_fields = $basket2->additional_field_values; >+is( ref($additional_fields), 'Koha::AdditionalFieldValues', '->additional_field_values should return a Koha::AdditionalFieldValues object' ); >+is_deeply( >+ [ >+ map { >+ { >+ # We are bascially removing the 'id' field here >+ field_id => $_->{field_id}, >+ record_id => $_->{record_id}, >+ value => $_->{value}, >+ } >+ } @{ $additional_fields->unblessed } >+ ], >+ [ >+ { >+ field_id => $additional_fields_for_basket2->[0]->{id}, >+ record_id => $basket2->basketno, >+ value => $additional_fields_for_basket2->[0]->{value}, >+ }, >+ { >+ field_id => $additional_fields_for_basket2->[1]->{id}, >+ record_id => $basket2->basketno, >+ value => $additional_fields_for_basket2->[1]->{value}, >+ } >+ >+ ], >+ '->additional_field_values should return the correct values' >+); > > my @baskets = Koha::Acquisition::Baskets->filter_by_additional_fields([ > { >-- >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 15774
:
48224
|
53608
|
53609
|
72078
|
72079
|
72085
|
72086
|
75083
|
75084
|
75085
|
75086
|
75336
|
75354
|
75361
|
79976
|
79977
|
79978
|
79979
|
79980
|
79981
|
79982
|
80060
|
80061
|
80062
|
80063
|
80064
|
80065
|
80066
|
80680
|
81490
|
81491
|
81492
|
81493
|
81494
|
81495
|
81496
|
81497
|
81833
|
81837
|
81838
|
81839
|
81840
|
81841
|
81842
|
81843
|
81844
|
81845
|
81846
|
81847
|
81848
|
81849
|
81850
|
81851
|
81852
|
83349
|
83350
|
83351
|
83352
|
83353
|
83354
|
83355
|
83356
|
83357
|
83358
|
83359
|
83360
|
83361
|
83362
|
83363
|
83364
|
83444
|
83445
|
83446
|
83447
|
83448
|
83449
|
83450
|
83451
|
83452
|
83453
|
83454
|
83455
|
83456
|
83457
|
83458
|
83459
|
85333
|
85334
|
85335
|
85336
|
85337
|
85338
|
85339
|
85340
|
85341
|
85342
|
85343
|
85344
|
85345
|
85346
|
85347
|
85348
|
85792
|
85806
|
85807
|
85808
|
85809
|
85810
|
85811
|
85812
|
85813
|
85814
|
85815
|
85816
| 85817 |
85818
|
85819
|
85820
|
85821
|
85822
|
85823
|
85824
|
86411