Bugzilla – Attachment 165094 Details for
Bug 35646
Allow using the publication date parts for serial numbering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35646: Unit tests
Bug-35646-Unit-tests.patch (text/plain), 3.10 KB, created by
Marcel de Rooy
on 2024-04-18 13:22:16 UTC
(
hide
)
Description:
Bug 35646: Unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-18 13:22:16 UTC
Size:
3.10 KB
patch
obsolete
>From c6dc44603bbe8907fd114a367e69f849798bdee4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 22 Dec 2023 18:52:57 +0000 >Subject: [PATCH] Bug 35646: Unit tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Serials.t | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 7a431c1edd..8f91362696 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -17,7 +17,7 @@ use Koha::Acquisition::Booksellers; > use t::lib::Mocks; > use t::lib::TestBuilder; > use Test::MockModule; >-use Test::More tests => 54; >+use Test::More tests => 55; > > BEGIN { > use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); >@@ -552,6 +552,43 @@ subtest "NewSubscription|ModSubscription" => sub { > is( $serials->next->biblionumber, $biblio_2->biblionumber, 'ModSubscription should have updated serial.biblionumber'); > }; > >+subtest "test numbering pattern with dates in GetSeq GetNextSeq" => sub { >+ plan tests => 4; >+ $subscription = { >+ lastvalue1 => 1, lastvalue2 => 1, lastvalue3 => 1, >+ innerloop1 => 0, innerloop2 => 0, innerloop3 => 0, >+ skip_serialseq => 0, >+ irregularity => '', >+ locale => 'C', # locale set to 'C' to ensure we'll have english strings >+ firstaquidate => '1970-11-01', >+ }; >+ $pattern = { >+ numberingmethod => '{Year} {Day} {DayName} {Month} {MonthName}', >+ }; >+ >+ my $numbering = GetSeq( $subscription, $pattern ); >+ is( $numbering, '1970 1 Sunday 11 November', 'GetSeq correctly calculates numbering from first aqui date' ); >+ $subscription->{firstaquidate} = '2024-02-29'; >+ >+ $numbering = GetSeq( $subscription, $pattern ); >+ is( >+ $numbering, '2024 29 Thursday 2 February', >+ 'GetSeq correctly calculates numbering from first aqui date, leap year' >+ ); >+ >+ my $planneddate = '1970-11-01'; >+ ($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate ); >+ is( $numbering, '1970 1 Sunday 11 November', 'GetNextSeq correctly calculates numbering from planned date' ); >+ $planneddate = '2024-02-29'; >+ ($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate ); >+ is( >+ $numbering, '2024 29 Thursday 2 February', >+ 'GetNextSeq correctly calculates numbering from planned date, leap year' >+ ); >+ >+}; >+ >+ > subtest "_numeration" => sub { > > plan tests => 6; >-- >2.30.2
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 35646
:
160275
|
160276
|
160277
|
160297
|
160298
|
165088
|
165089
|
165090
|
165093
| 165094 |
165095