Bugzilla – Attachment 98333 Details for
Bug 18936
Move issuingrules into circulation_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18936: Fix inconsistencies in IssuingRules.t
Bug-18936-Fix-inconsistencies-in-IssuingRulest.patch (text/plain), 16.76 KB, created by
Jonathan Druart
on 2020-02-03 16:08:47 UTC
(
hide
)
Description:
Bug 18936: Fix inconsistencies in IssuingRules.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-03 16:08:47 UTC
Size:
16.76 KB
patch
obsolete
>From 1f7e65a6aa09111fbe4986259bdb924b175ee858 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 27 Jan 2020 10:13:44 +0100 >Subject: [PATCH] Bug 18936: Fix inconsistencies in IssuingRules.t >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >* get_effective_rule should not pass rule_value >* indentation fix >* add comment to list the rules we have when the test _is_row_match >is executed >* compare ->rule_name and ->rule_value returns > >Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > t/db_dependent/Koha/IssuingRules.t | 254 +++++++++++++++++++++++++------------ > 1 file changed, 170 insertions(+), 84 deletions(-) > >diff --git a/t/db_dependent/Koha/IssuingRules.t b/t/db_dependent/Koha/IssuingRules.t >index 7af584d17d..2cdb143a93 100644 >--- a/t/db_dependent/Koha/IssuingRules.t >+++ b/t/db_dependent/Koha/IssuingRules.t >@@ -49,6 +49,7 @@ subtest 'get_effective_issuing_rule' => sub { > Koha::CirculationRules->delete; > > is(Koha::CirculationRules->search->count, 0, 'There are no issuing rules.'); >+ # undef, undef, undef => 1 > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => undef, > categorycode => undef, >@@ -58,27 +59,34 @@ subtest 'get_effective_issuing_rule' => sub { > }); > is($rule, undef, 'When I attempt to get effective issuing rule by' > .' providing undefined values, then undef is returned.'); >- ok(Koha::CirculationRule->new({ >- branchcode => undef, >- categorycode => undef, >- itemtype => undef, >- rule_name => 'fine', >- rule_value => 2, >- })->store, 'Given I added an issuing rule branchcode => undef,' >+ >+ # undef, undef, undef => 2 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 2, >+ } >+ )->store, >+ 'Given I added an issuing rule branchcode => undef,' > .' categorycode => undef, itemtype => undef,'); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => undef, > categorycode => undef, > itemtype => undef, > rule_name => 'fine', >- rule_value => 3, > }); > _is_row_match( > $rule, > { >- branchcode => undef, >+ branchcode => undef, > categorycode => undef, >- itemtype => undef >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 2, > }, > 'When I attempt to get effective' > .' issuing rule by providing undefined values, then the above one is' >@@ -97,11 +105,11 @@ subtest 'get_effective_issuing_rule' => sub { > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 4, > }); > is($rule, undef, 'When I attempt to get effective issuing rule, then undef' > .' is returned.'); > >+ # undef, undef, undef => 5 > ok(Koha::CirculationRule->new({ > branchcode => undef, > categorycode => undef, >@@ -114,189 +122,267 @@ subtest 'get_effective_issuing_rule' => sub { > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 6, > }); > _is_row_match( > $rule, > { >- branchcode => undef, >+ branchcode => undef, > categorycode => undef, >- itemtype => undef >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 5, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => undef, >- categorycode => undef, >- itemtype => $itemtype, >- rule_name => 'fine', >- rule_value => 7, >- })->store, "Given I added an issuing rule branchcode => undef, categorycode => undef, itemtype => $itemtype,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 7, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => undef, categorycode => undef, itemtype => $itemtype," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 8, > }); > _is_row_match( > $rule, > { >- branchcode => undef, >+ branchcode => undef, > categorycode => undef, >- itemtype => $itemtype >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 7, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => undef, >- categorycode => $categorycode, >- itemtype => undef, >- rule_name => 'fine', >- rule_value => 9, >- })->store, "Given I added an issuing rule branchcode => undef, categorycode => $categorycode, itemtype => undef,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => undef, >+ categorycode => $categorycode, >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 9, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => undef, categorycode => $categorycode, itemtype => undef," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 10, > }); > _is_row_match( > $rule, > { >- branchcode => undef, >+ branchcode => undef, > categorycode => $categorycode, >- itemtype => undef >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 9, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => undef, >- categorycode => $categorycode, >- itemtype => $itemtype, >- rule_name => 'fine', >- rule_value => 11, >- })->store, "Given I added an issuing rule branchcode => undef, categorycode => $categorycode, itemtype => $itemtype,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ # undef, $categorycode, $itemtype => 11 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => undef, >+ categorycode => $categorycode, >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 11, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => undef, categorycode => $categorycode, itemtype => $itemtype," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 12, > }); > _is_row_match( > $rule, > { >- branchcode => undef, >+ branchcode => undef, > categorycode => $categorycode, >- itemtype => $itemtype >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 11, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => $branchcode, >- categorycode => undef, >- itemtype => undef, >- rule_name => 'fine', >- rule_value => 13, >- })->store, "Given I added an issuing rule branchcode => $branchcode, categorycode => undef, itemtype => undef,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ # undef, $categorycode, $itemtype => 11 >+ # $branchcode, undef, undef => 13 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => $branchcode, >+ categorycode => undef, >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 13, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => $branchcode, categorycode => undef, itemtype => undef," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 14, > }); > _is_row_match( > $rule, > { >- branchcode => $branchcode, >+ branchcode => $branchcode, > categorycode => undef, >- itemtype => undef >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 13, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => $branchcode, >- categorycode => undef, >- itemtype => $itemtype, >- rule_name => 'fine', >- rule_value => 15, >- })->store, "Given I added an issuing rule branchcode => $branchcode, categorycode => undef, itemtype => $itemtype,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ # undef, $categorycode, $itemtype => 11 >+ # $branchcode, undef, undef => 13 >+ # $branchcode, undef, $itemtype => 15 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => $branchcode, >+ categorycode => undef, >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 15, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => $branchcode, categorycode => undef, itemtype => $itemtype," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 16, > }); > _is_row_match( > $rule, > { >- branchcode => $branchcode, >+ branchcode => $branchcode, > categorycode => undef, >- itemtype => $itemtype >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 15, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => $branchcode, >- categorycode => $categorycode, >- itemtype => undef, >- rule_name => 'fine', >- rule_value => 17, >- })->store, "Given I added an issuing rule branchcode => $branchcode, categorycode => $categorycode, itemtype => undef,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ # undef, $categorycode, $itemtype => 11 >+ # $branchcode, undef, undef => 13 >+ # $branchcode, undef, $itemtype => 15 >+ # $branchcode, $categorycode, undef => 17 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => $branchcode, >+ categorycode => $categorycode, >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 17, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => $branchcode, categorycode => $categorycode, itemtype => undef," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 18, > }); > _is_row_match( > $rule, > { >- branchcode => $branchcode, >+ branchcode => $branchcode, > categorycode => $categorycode, >- itemtype => undef >+ itemtype => undef, >+ rule_name => 'fine', >+ rule_value => 17, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' > ); > >- ok(Koha::CirculationRule->new({ >- branchcode => $branchcode, >- categorycode => $categorycode, >- itemtype => $itemtype, >- rule_name => 'fine', >- rule_value => 19, >- })->store, "Given I added an issuing rule branchcode => $branchcode, categorycode => $categorycode, itemtype => $itemtype,"); >+ # undef, undef, undef => 5 >+ # undef, undef, $itemtype => 7 >+ # undef, $categorycode, undef => 9 >+ # undef, $categorycode, $itemtype => 11 >+ # $branchcode, undef, undef => 13 >+ # $branchcode, undef, $itemtype => 15 >+ # $branchcode, $categorycode, undef => 17 >+ # $branchcode, $categorycode, $itemtype => 19 >+ ok( >+ Koha::CirculationRule->new( >+ { >+ branchcode => $branchcode, >+ categorycode => $categorycode, >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 19, >+ } >+ )->store, >+ "Given I added an issuing rule branchcode => $branchcode, categorycode => $categorycode, itemtype => $itemtype," >+ ); > $rule = Koha::CirculationRules->get_effective_rule({ > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, > rule_name => 'fine', >- rule_value => 20, > }); > _is_row_match( > $rule, > { >- branchcode => $branchcode, >+ branchcode => $branchcode, > categorycode => $categorycode, >- itemtype => $itemtype >+ itemtype => $itemtype, >+ rule_name => 'fine', >+ rule_value => 19, > }, > 'When I attempt to get effective issuing rule,' > .' then the above one is returned.' >-- >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 18936
:
65247
|
65248
|
65249
|
67629
|
67758
|
68236
|
71034
|
71035
|
71036
|
71037
|
71038
|
71039
|
71040
|
71041
|
72230
|
72231
|
72232
|
72233
|
72234
|
72235
|
72236
|
72237
|
72238
|
91953
|
91954
|
91955
|
91956
|
91957
|
91958
|
91959
|
91960
|
91961
|
91962
|
91963
|
91964
|
91965
|
91966
|
91967
|
91968
|
91969
|
91970
|
91971
|
91972
|
91973
|
91974
|
91975
|
94179
|
94180
|
94181
|
94182
|
94183
|
94184
|
94185
|
94186
|
94187
|
94188
|
94189
|
94190
|
94191
|
94192
|
94193
|
94194
|
94195
|
94196
|
94197
|
94198
|
94199
|
94200
|
98299
|
98300
|
98301
|
98302
|
98303
|
98304
|
98305
|
98306
|
98307
|
98308
|
98309
|
98310
|
98311
|
98312
|
98313
|
98314
|
98315
|
98316
|
98317
|
98318
|
98319
|
98320
|
98321
|
98322
|
98323
|
98324
|
98325
|
98326
|
98327
|
98328
|
98329
|
98330
|
98331
|
98332
| 98333 |
98334
|
98335
|
98336
|
98337
|
98338
|
98339
|
98340
|
98341
|
98342
|
98343
|
98344
|
98345
|
98346
|
98347
|
98407
|
98408