From dd2f080c01d657bd26a38aeca2226c51682e3c73 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 29 Jun 2018 11:02:40 -0300 Subject: [PATCH] Bug 21022: Unit tests Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- t/Koha/Exceptions.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/Koha/Exceptions.t b/t/Koha/Exceptions.t index 8fd37aa1ac..c306d31cb9 100644 --- a/t/Koha/Exceptions.t +++ b/t/Koha/Exceptions.t @@ -22,7 +22,7 @@ use Test::Exception; subtest 'Koha::Exceptions::Object::FKConstraint tests' => sub { - plan tests => 3; + plan tests => 5; use_ok('Koha::Exceptions::Object'); @@ -34,5 +34,10 @@ subtest 'Koha::Exceptions::Object::FKConstraint tests' => sub { # stringify the exception is( "$@", 'Invalid parameter passed, nasty=fk does not exist', 'Exception stringified correctly' ); + throws_ok + { Koha::Exceptions::Object::FKConstraint->throw( "Manual message exception" ) } + 'Koha::Exceptions::Object::FKConstraint', + 'Exception is thrown :-D'; + is( "$@", 'Manual message exception', 'Exception not stringified if manually passed' ); }; -- 2.11.0