Bug 27014: (QA follow-up) Add regression tests
This patch adds a regression test for the change introduced in the patchset. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
05e16389ef
commit
d9c6365793
1 changed files with 27 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
# This needs to be extended! Your help is appreciated..
|
||||
|
||||
use Modern::Perl;
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 8;
|
||||
|
||||
use t::lib::Mocks;
|
||||
use t::lib::TestBuilder;
|
||||
|
@ -32,6 +32,32 @@ $schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
|
|||
my $sip_patron2 = C4::SIP::ILS::Patron->new( $card );
|
||||
is( $sip_patron2, undef, "Patron is not valid (anymore)" );
|
||||
|
||||
subtest "new tests" => sub {
|
||||
|
||||
plan tests => 5;
|
||||
|
||||
my $patron = $builder->build(
|
||||
{
|
||||
source => 'Borrower'
|
||||
}
|
||||
);
|
||||
|
||||
my $cardnumber = $patron->{cardnumber};
|
||||
my $userid = $patron->{userid};
|
||||
my $borrowernumber = $patron->{borrowernumber};
|
||||
|
||||
my $ils_patron = C4::SIP::ILS::Patron->new($cardnumber);
|
||||
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via cardnumber scalar' );
|
||||
$ils_patron = C4::SIP::ILS::Patron->new($userid);
|
||||
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via userid scalar' );
|
||||
$ils_patron = C4::SIP::ILS::Patron->new( { borrowernumber => $borrowernumber } );
|
||||
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via borrowernumber hashref' );
|
||||
$ils_patron = C4::SIP::ILS::Patron->new( { cardnumber => $cardnumber } );
|
||||
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via cardnumber hashref' );
|
||||
$ils_patron = C4::SIP::ILS::Patron->new( { userid => $userid } );
|
||||
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via userid hashref' );
|
||||
};
|
||||
|
||||
subtest "OverduesBlockCirc tests" => sub {
|
||||
|
||||
plan tests => 6;
|
||||
|
|
Loading…
Reference in a new issue