Browse Source

Bug 13084 [Master] - Improve t/db_dependent/Members.t test coverage

Added a MoveMemberToDeleted set of tests.

TEST PLAN
---------
1) prove -v t/db_dependent/Members.t
   -- all should pass.
2) Run koha QA tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
MM-OPAC/theme_dep
Mark Tompsett 8 years ago
committed by Tomas Cohen Arazi
parent
commit
c4852dbb14
  1. 16
      t/db_dependent/Members.t

16
t/db_dependent/Members.t

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::More tests => 56;
use Test::More tests => 58;
use Test::MockModule;
use Data::Dumper;
use C4::Context;
@ -85,6 +85,20 @@ my %data = (
my $addmem=AddMember(%data);
ok($addmem, "AddMember()");
# It's not really a Move, it's a Copy.
my $result = MoveMemberToDeleted($addmem);
ok($result,"MoveMemberToDeleted()");
my $sth = $dbh->prepare("SELECT * from borrowers WHERE borrowernumber=?");
$sth->execute($addmem);
my $MemberAdded = $sth->fetchrow_hashref;
$sth = $dbh->prepare("SELECT * from deletedborrowers WHERE borrowernumber=?");
$sth->execute($addmem);
my $MemberMoved = $sth->fetchrow_hashref;
is_deeply($MemberMoved,$MemberAdded,"Confirm MoveMemberToDeleted.");
my $member=GetMemberDetails("",$CARDNUMBER)
or BAIL_OUT("Cannot read member with card $CARDNUMBER");

Loading…
Cancel
Save