Bugzilla – Attachment 77880 Details for
Bug 21233
Add Koha::Exceptions::Password class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21233: Unit tests
Bug-21233-Unit-tests.patch (text/plain), 1.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-08-16 09:58:18 UTC
(
hide
)
Description:
Bug 21233: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-08-16 09:58:18 UTC
Size:
1.82 KB
patch
obsolete
>From 7acb4ea7d5939f4fadde8347a58f6bccc7abb043 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 16 Aug 2018 06:54:53 -0300 >Subject: [PATCH] Bug 21233: Unit tests > >This patch adds tests for the required password-related exceptions. The >tests verify the stringified version of the exceptions. > >To test: >- Apply this patch >- Run: > $ kshell > k$ prove t/Koha/Exceptions.t >=> FAIL: Exceptions not implemented, tests fail! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/Koha/Exceptions.t | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/Exceptions.t b/t/Koha/Exceptions.t >index c306d31cb9..7ecc115cfd 100644 >--- a/t/Koha/Exceptions.t >+++ b/t/Koha/Exceptions.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::Exception; > > subtest 'Koha::Exceptions::Object::FKConstraint tests' => sub { >@@ -41,3 +41,23 @@ subtest 'Koha::Exceptions::Object::FKConstraint tests' => sub { > is( "$@", 'Manual message exception', 'Exception not stringified if manually passed' ); > }; > >+subtest 'Koha::Exceptions::Password tests' => sub { >+ >+ plan tests => 5; >+ >+ use_ok('Koha::Exceptions::Password'); >+ >+ throws_ok >+ { Koha::Exceptions::Password::TooShort->throw( length => 4, min_length => 5 ); } >+ 'Koha::Exceptions::Password::TooShort', >+ 'Exception is thrown :-D'; >+ >+ # stringify the exception >+ is( "$@", 'Password length (4) is shorter than required (5)', 'Exception stringified correctly' ); >+ >+ throws_ok >+ { Koha::Exceptions::Password::TooShort->throw( "Manual message exception" ) } >+ 'Koha::Exceptions::Password::TooShort', >+ 'Exception is thrown :-D'; >+ is( "$@", 'Manual message exception', 'Exception not stringified if manually passed' ); >+}; >-- >2.18.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21233
:
77880
|
77881
|
77914
|
77915
|
78116
|
78117
|
78118
|
78721
|
78836