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

(-)a/t/db_dependent/SIP/Message.t (-1 / +39 lines)
Lines 1637-1642 sub test_renew_desensitize { Link Here
1637
1637
1638
}
1638
}
1639
1639
1640
subtest 'Test  convert_nonprinting_characters' => sub {
1641
1642
    my $schema = Koha::Database->new->schema;
1643
    $schema->storage->txn_begin;
1644
1645
    plan tests => 1;
1646
    my $builder = t::lib::TestBuilder->new();
1647
    my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
1648
    my ( $response, $findpatron );
1649
    my $mocks = create_mocks( \$response, \$findpatron, \$branchcode );
1650
    my $seen_patron = $builder->build({
1651
        source => 'Borrower',
1652
        value  => {
1653
            lastseen => '2001-01-01',
1654
            password => hash_password( PATRON_PW ),
1655
            branchcode => $branchcode,
1656
            dateexpiry => '3000-01-01',
1657
            debarred => '3000-01-01',
1658
            debarredcomment => "Comment 1\nComment 2\nComment 3",
1659
        },
1660
    });
1661
    my $cardnum = $seen_patron->{cardnumber};
1662
    my $sip_patron = C4::SIP::ILS::Patron->new( $cardnum );
1663
    $findpatron = $sip_patron;
1664
1665
        my $siprequest = PATRON_INFO . 'engYYYYMMDDZZZZHHMMSS' . '          ' .
1666
            FID_INST_ID . $branchcode . '|' .
1667
            FID_PATRON_ID . $cardnum . '|' .
1668
            FID_PATRON_PWD . PATRON_PW . '|';
1669
        my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
1670
1671
    my $server = { ils => $mocks->{ils}, account => { convert_nonprinting_characters => ' -- '}  };
1672
    $msg->handle_patron_info( $server );
1673
1674
    like( $response, qr/Comment 1 -- Comment 2 -- Comment 3/, "Response contains converted restriction comment" );
1675
1676
    $schema->storage->txn_rollback;
1677
};
1678
1640
# Helper routines
1679
# Helper routines
1641
1680
1642
sub create_mocks {
1681
sub create_mocks {
1643
- 

Return to bug 37582