Bugzilla – Attachment 185205 Details for
Bug 17656
Irregularities in serial prediction pattern are planned only for current subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17656: (QA follow-up) fix tests
Bug-17656-QA-follow-up-fix-tests.patch (text/plain), 4.93 KB, created by
Arthur Suzuki
on 2025-08-07 09:38:10 UTC
(
hide
)
Description:
Bug 17656: (QA follow-up) fix tests
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2025-08-07 09:38:10 UTC
Size:
4.93 KB
patch
obsolete
>From 74afa350a986f42705406c528ed5eb5ef629716b Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Thu, 7 Aug 2025 09:17:46 +0000 >Subject: [PATCH] Bug 17656: (QA follow-up) fix tests > >--- > t/Serials/IssueNumber.t | 23 ++++++++++--------- > t/db_dependent/Koha/Subscription.t | 2 +- > .../Koha/Subscription/GuessEnddate.t | 0 > .../Koha/Subscription/Irregularities.t | 15 ++++++++---- > .../Serials/SubscriptionIrregularity.t | 0 > 5 files changed, 23 insertions(+), 17 deletions(-) > mode change 100644 => 100755 t/Serials/IssueNumber.t > mode change 100644 => 100755 t/db_dependent/Koha/Subscription/GuessEnddate.t > mode change 100644 => 100755 t/db_dependent/Koha/Subscription/Irregularities.t > mode change 100644 => 100755 t/db_dependent/Serials/SubscriptionIrregularity.t > >diff --git a/t/Serials/IssueNumber.t b/t/Serials/IssueNumber.t >old mode 100644 >new mode 100755 >index d9cd65331bd..1dbe8b8b3fb >--- a/t/Serials/IssueNumber.t >+++ b/t/Serials/IssueNumber.t >@@ -17,8 +17,9 @@ > > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 9; > use Test::Warn; >+use Test::Exception; > > BEGIN { > use_ok('C4::Serials'); >@@ -26,22 +27,22 @@ BEGIN { > > my $dt = DateTime->new( year => 2017, month => 1, day => 1 ); > >-eval { issue_number( '2017', 'day' ); }; >-is( ref($@), 'Koha::Exceptions::WrongParameter' ); >-is( $@, 'Date passed to issue_number is not a valid DateTime object' ); >+throws_ok { C4::Serials::issue_number( '2017', 'day' ) } >+'Koha::Exceptions::WrongParameter', >+ 'Date passed to issue_number is not a valid DateTime object'; > >-is( issue_number( $dt, 'day' ), 7, '2017-01-01 is the seventh day of week' ); >+is( C4::Serials::issue_number( $dt, 'day' ), 7, '2017-01-01 is the seventh day of week' ); > >-is( issue_number( $dt, 'week' ), 52, '2017-01-01 is the week #52 of the year' ); >+is( C4::Serials::issue_number( $dt, 'week' ), 52, '2017-01-01 is the week #52 of the year' ); > >-is( issue_number( $dt, 'month' ), 1, '2017-01-01 is the first month of the year' ); >+is( C4::Serials::issue_number( $dt, 'month' ), 1, '2017-01-01 is the first month of the year' ); > > $dt = DateTime->new( year => 2022, month => 9, day => 17 ); > >-is( issue_number( $dt, 'day' ), 6, '2022-09-17 is the sixth day of week' ); >+is( C4::Serials::issue_number( $dt, 'day' ), 6, '2022-09-17 is the sixth day of week' ); > >-is( issue_number( $dt, 'week' ), 37, '2022-09-17 is the week #37 of the year' ); >+is( C4::Serials::issue_number( $dt, 'week' ), 37, '2022-09-17 is the week #37 of the year' ); > >-is( issue_number( $dt, 'month' ), 9, '2022-09-17 is the ninth month of the year' ); >+is( C4::Serials::issue_number( $dt, 'month' ), 9, '2022-09-17 is the ninth month of the year' ); > >-is( issue_number( $dt, 'foo' ), 0, 'issue_number return 0 for others issue type' ); >+is( C4::Serials::issue_number( $dt, 'foo' ), 0, 'issue_number return 0 for others issue type' ); >diff --git a/t/db_dependent/Koha/Subscription.t b/t/db_dependent/Koha/Subscription.t >index 45f40546513..beec6f81975 100755 >--- a/t/db_dependent/Koha/Subscription.t >+++ b/t/db_dependent/Koha/Subscription.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 11; >+use Test::More tests => 12; > > use Koha::Database; > use Koha::Subscription; >diff --git a/t/db_dependent/Koha/Subscription/GuessEnddate.t b/t/db_dependent/Koha/Subscription/GuessEnddate.t >old mode 100644 >new mode 100755 >diff --git a/t/db_dependent/Koha/Subscription/Irregularities.t b/t/db_dependent/Koha/Subscription/Irregularities.t >old mode 100644 >new mode 100755 >index 122d2dae399..b71ffe3b5f4 >--- a/t/db_dependent/Koha/Subscription/Irregularities.t >+++ b/t/db_dependent/Koha/Subscription/Irregularities.t >@@ -85,7 +85,7 @@ my $subscription = $builder->build( > firstacquidate => '2018-05-07', > irregularity => '3;4', > permanent_irregularity => '3;4', >- numberpattern => 7, >+ numberpattern => $number_pattern->{id}, > enddate => '2018-05-13', > closed => 0 > } >@@ -182,10 +182,15 @@ $builder->build( > } > ); > >-ReNewSubscription( >- $subscription->{subscriptionid}, undef, >- $subscription->{enddate}, $subscription->{numberlength}, >- $subscription->{weeklength}, $subscription->{monthlength}, >+C4::Serials::ReNewSubscription( >+ { >+ subscriptionid => $subscription->{subscriptionid}, >+ user => undef, >+ startdate => $subscription->{enddate}, >+ numberlength => $subscription->{numberlength}, >+ weeklength => $subscription->{weeklength}, >+ monthlength => $subscription->{monthlength}, >+ } > ); > > my $s = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >diff --git a/t/db_dependent/Serials/SubscriptionIrregularity.t b/t/db_dependent/Serials/SubscriptionIrregularity.t >old mode 100644 >new mode 100755 >-- >2.39.5
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 17656
:
68259
|
68261
|
68607
|
68608
|
68665
|
69124
|
69207
|
69279
|
69553
|
69814
|
69820
|
69915
|
70335
|
70336
|
70430
|
70619
|
75403
|
75404
|
75405
|
75406
|
75407
|
75408
|
75721
|
75722
|
75723
|
75724
|
75725
|
75726
|
75953
|
102724
|
102725
|
102726
|
102727
|
102728
|
102729
|
102730
|
102860
|
102861
|
102862
|
102863
|
102864
|
102865
|
102866
|
102867
|
102960
|
102961
|
102962
|
102963
|
102964
|
102965
|
102966
|
102967
|
102968
|
103623
|
103624
|
103625
|
103626
|
103627
|
103628
|
103629
|
103630
|
103631
|
103657
|
103658
|
103659
|
103660
|
103661
|
103662
|
103663
|
103664
|
103665
|
103667
|
117789
|
117790
|
117791
|
117792
|
117846
|
117851
|
117852
|
118856
|
119106
|
120863
|
121082
|
121083
|
121084
|
121085
|
121086
|
121087
|
121088
|
121192
|
121193
|
121194
|
121195
|
121196
|
121197
|
121198
|
121296
|
121297
|
121298
|
121299
|
121300
|
121301
|
121302
|
128489
|
128491
|
128492
|
128493
|
128494
|
128495
|
128496
|
128498
|
128499
|
128500
|
128501
|
128502
|
128503
|
128504
|
132412
|
132413
|
132415
|
132416
|
132417
|
132418
|
132447
|
132448
|
132692
|
132779
|
177497
|
177498
|
177499
|
177500
|
177501
|
177502
|
177503
|
177504
|
177505
|
177663
|
177664
|
177665
|
177666
|
177667
|
177668
|
177669
|
177670
|
177671
|
177831
|
177832
|
177833
|
177834
|
177835
|
177836
|
177837
|
177838
|
177839
|
178142
|
185196
|
185197
|
185198
|
185199
|
185200
|
185201
|
185202
|
185203
|
185204
| 185205 |
185206
|
185207
|
185208