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

(-)a/t/db_dependent/MarcModificationTemplates.t (-10 / +26 lines)
Lines 1-6 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
use Test::More tests => 126;
3
use Test::More tests => 127;
4
4
5
use Koha::Database;
5
use Koha::Database;
6
use Koha::SimpleMARC;
6
use Koha::SimpleMARC;
Lines 691-696 sub new_record_0 { Link Here
691
            a => 'Computer programming.',
691
            a => 'Computer programming.',
692
            9 => '462',
692
            9 => '462',
693
        ),
693
        ),
694
        MARC::Field->new(
695
            590, ' ', '0',
696
            0 => 'Zeroth',
697
            a => 'Appolo',
698
        ),
694
    );
699
    );
695
    $record->append_fields(@fields);
700
    $record->append_fields(@fields);
696
    return $record;
701
    return $record;
Lines 704-709 sub expected_record_0 { Link Here
704
            100, '1', ' ',
709
            100, '1', ' ',
705
            a => 'Knuth, Donald Ervin',
710
            a => 'Knuth, Donald Ervin',
706
            d => '1938',
711
            d => '1938',
712
            0 => 'TestUpdated',
713
            0 => 'TestUpdated',
707
        ),
714
        ),
708
        MARC::Field->new(
715
        MARC::Field->new(
709
            245, '1', '4',
716
            245, '1', '4',
Lines 718-742 sub expected_record_0 { Link Here
718
            9 => '462',
725
            9 => '462',
719
        ),
726
        ),
720
        MARC::Field->new(
727
        MARC::Field->new(
721
            600, ' ', ' ',
728
            590, ' ', '0',
722
            0 => 'TestUpdated',
729
            0 => 'Zeroth',
730
            a => 'Appolo',
723
        ),
731
        ),
724
        MARC::Field->new(
732
        MARC::Field->new(
725
            600, ' ', ' ',
733
            600, ' ', ' ',
726
            0 => 'TestUpdated',
734
            0 => 'TestUpdated',
727
        ),
735
        ),
728
        MARC::Field->new(
736
        MARC::Field->new(
729
            100, ' ', ' ',
737
            600, ' ', ' ',
730
            0 => 'TestUpdated',
731
        ),
732
        MARC::Field->new(
733
            100, ' ', ' ',
734
            0 => 'TestUpdated',
738
            0 => 'TestUpdated',
735
        ),
739
        ),
736
        MARC::Field->new(
740
        MARC::Field->new(
737
            700, ' ', ' ',
741
            700, ' ', ' ',
738
            0 => '12345',
742
            0 => '12345',
739
        ),
743
        ),
744
        MARC::Field->new(
745
            690, ' ', ' ',
746
            0 => 'Zeroth',
747
        ),
740
    );
748
    );
741
    $record->append_fields(@fields);
749
    $record->append_fields(@fields);
742
    return $record;
750
    return $record;
Lines 802-809 is( AddModificationTemplateAction( Link Here
802
    'Action 6: Copy and replace subfield 245$0 to 700$0'
810
    'Action 6: Copy and replace subfield 245$0 to 700$0'
803
), 1, 'Action 6: Copy and replace subfield 245$0 to 700$0');
811
), 1, 'Action 6: Copy and replace subfield 245$0 to 700$0');
804
812
813
# Copy subfield 590$0 to 690$0
814
is( AddModificationTemplateAction(
815
    $template_id, 'copy_field', 0,
816
    '590', '0', '', '690', '0',
817
    '', '', '',
818
    '', '', '', '', '', '',
819
    'Action 7: Copy subfield 590$0 to 690$0'
820
), 1, 'Action 7: Copy subfield 590$0 to 690$0');
821
805
my @actions_0 = GetModificationTemplateActions( $template_id );
822
my @actions_0 = GetModificationTemplateActions( $template_id );
806
is( @actions_0, 6, "6 actions are inserted");
823
is( @actions_0, 7, "7 actions are inserted");
807
824
808
ModifyRecordWithTemplate( $template_id, $record );
825
ModifyRecordWithTemplate( $template_id, $record );
809
my $expected_record_0 = expected_record_0();
826
my $expected_record_0 = expected_record_0();
810
- 

Return to bug 31644