View | Details | Raw Unified | Return to bug 35646
Collapse All | Expand All

(-)a/t/db_dependent/Serials.t (-2 / +38 lines)
Lines 16-22 use Koha::DateUtils qw( dt_from_string output_pref ); Link Here
16
use Koha::Acquisition::Booksellers;
16
use Koha::Acquisition::Booksellers;
17
use t::lib::Mocks;
17
use t::lib::Mocks;
18
use t::lib::TestBuilder;
18
use t::lib::TestBuilder;
19
use Test::More tests => 54;
19
use Test::More tests => 55;
20
20
21
BEGIN {
21
BEGIN {
22
    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 ));
22
    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 ));
Lines 547-552 subtest "NewSubscription|ModSubscription" => sub { Link Here
547
    is( $serials->next->biblionumber, $biblio_2->biblionumber, 'ModSubscription should have updated serial.biblionumber');
547
    is( $serials->next->biblionumber, $biblio_2->biblionumber, 'ModSubscription should have updated serial.biblionumber');
548
};
548
};
549
549
550
subtest "test numbering pattern with dates in GetSeq GetNextSeq" => sub {
551
    plan tests => 4;
552
    $subscription = {
553
        lastvalue1     => 1, lastvalue2 => 1, lastvalue3 => 1,
554
        innerloop1     => 0, innerloop2 => 0, innerloop3 => 0,
555
        skip_serialseq => 0,
556
        irregularity   => '',
557
        locale         => 'C',            # locale set to 'C' to ensure we'll have english strings
558
        firstaquidate  => '1970-11-01',
559
    };
560
    $pattern = {
561
        numberingmethod => '{Year} {Day} {DayName} {Month} {MonthName}',
562
    };
563
564
    my $numbering = GetSeq( $subscription, $pattern );
565
    is( $numbering, '1970 1 Sunday 11 November', 'GetSeq correctly calculates numbering from first aqui date' );
566
    $subscription->{firstaquidate} = '2024-02-29';
567
568
    $numbering = GetSeq( $subscription, $pattern );
569
    is(
570
        $numbering, '2024 29 Thursday 2 February',
571
        'GetSeq correctly calculates numbering from first aqui date, leap year'
572
    );
573
574
    my $planneddate = '1970-11-01';
575
    ($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate );
576
    is( $numbering, '1970 1 Sunday 11 November', 'GetNextSeq correctly calculates numbering from planned date' );
577
    $planneddate = '2024-02-29';
578
    ($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate );
579
    is(
580
        $numbering, '2024 29 Thursday 2 February',
581
        'GetNextSeq correctly calculates numbering from planned date, leap year'
582
    );
583
584
};
585
586
550
subtest "_numeration" => sub {
587
subtest "_numeration" => sub {
551
588
552
    plan tests => 6;
589
    plan tests => 6;
553
- 

Return to bug 35646