From d3444b3728200358b9c2d7ef6da6d0db0dc9753c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 31 Oct 2019 11:22:09 +0000 Subject: [PATCH] Bug 22706: (RM follow-up) Add unit tests Signed-off-by: Martin Renvoize --- t/lib/Koha/Plugin/Test.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm index e34b61d5d1..7a963d9565 100644 --- a/t/lib/Koha/Plugin/Test.pm +++ b/t/lib/Koha/Plugin/Test.pm @@ -213,6 +213,21 @@ sub api_routes { return decode_json($spec); } +sub check_password { + my ( $self, $args ) = @_; + + my $password = $args->{'password'}; + if ( $password && $password =~ m/^\d\d\d\d$/ ) { + return { error => 0 }; + } + else { + return { + error => 1, + msg => "PIN should be four digits" + }; + } +} + sub _private_sub { return ""; } -- 2.39.5