Interactive tests for SIP abstraction representation and Members.
authorJoe Atzberger (siptest <atz4sip@arwen.metavore.com>
Tue, 24 Jun 2008 22:35:13 +0000 (17:35 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 25 Jun 2008 16:45:30 +0000 (11:45 -0500)
The test for members is useful to compare against the SIP (ILS)
representation.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/SIP/interactive_members_dump.pl [new file with mode: 0755]
C4/SIP/interactive_patron_check_password.pl [new file with mode: 0755]

diff --git a/C4/SIP/interactive_members_dump.pl b/C4/SIP/interactive_members_dump.pl
new file mode 100755 (executable)
index 0000000..8df6ea4
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+#
+
+use warnings;
+use strict;
+
+use C4::Members;
+use Data::Dumper;
+
+while (1) {
+       print "Enter patron barcode: ";
+       my $in = <>;
+       defined($in) or last;
+       chomp($in);
+       last unless $in;
+       print "GetMember : \n",  Dumper(GetMember($in, 'cardnumber'));
+       my ($member) = GetMemberDetails(undef, $in);
+       my $flags = $member->{flags};
+       print "GetMemberDetails (member) : \n", Dumper($member);
+       print "GetMemberDetails ( flags) : \n", Dumper($flags);
+       print "=" x 10, "\n";
+}
diff --git a/C4/SIP/interactive_patron_check_password.pl b/C4/SIP/interactive_patron_check_password.pl
new file mode 100755 (executable)
index 0000000..a56701c
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+#
+
+use warnings;
+use strict;
+
+use ILS::Patron;
+use Sip qw(sipbool);
+use Data::Dumper;
+
+while (1) {
+       print "Enter patron barcode: ";
+       my $in = <>;
+       defined($in) or last;
+       chomp($in);
+       last unless $in;
+       my $patron = ILS::Patron->new($in);
+       print Dumper($patron);
+       $patron or next;
+       print "Enter patron password: ";
+       $in = <>;
+       chomp($in);
+       print "Raw password is: " . $patron->{password}, "\n"; 
+       print " check_password: " . $patron->check_password($in), "\n"; 
+       print "        sipbool: " . sipbool($patron->check_password($in)), "\n"; 
+}