Bugzilla – Attachment 144391 Details for
Bug 32334
Sync comments in database with schema
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32334: Exceptions - Add parameter to WrongParameter
Bug-32334-Exceptions---Add-parameter-to-WrongParam.patch (text/plain), 1.87 KB, created by
Marcel de Rooy
on 2022-12-02 10:50:32 UTC
(
hide
)
Description:
Bug 32334: Exceptions - Add parameter to WrongParameter
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-12-02 10:50:32 UTC
Size:
1.87 KB
patch
obsolete
>From 7aa1e45cdf72a16055f2f67ba694e11b89e73bda Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 1 Dec 2022 08:51:53 +0000 >Subject: [PATCH] Bug 32334: Exceptions - Add parameter to WrongParameter >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/Koha/Exceptions.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Exceptions.pm | 3 ++- > t/Koha/Exceptions.t | 14 +++++++++++++- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/Koha/Exceptions.pm b/Koha/Exceptions.pm >index 80156abee7..00f45f661d 100644 >--- a/Koha/Exceptions.pm >+++ b/Koha/Exceptions.pm >@@ -55,7 +55,8 @@ use Exception::Class ( > }, > 'Koha::Exceptions::WrongParameter' => { > isa => 'Koha::Exception', >- description => 'One or more parameters are wrong', >+ description => 'Parameter has wrong value or type', >+ fields => ['name', 'value', 'type'], > }, > 'Koha::Exceptions::NoPermission' => { > isa => 'Koha::Exception', >diff --git a/t/Koha/Exceptions.t b/t/Koha/Exceptions.t >index fc3afb1601..748a0f8084 100755 >--- a/t/Koha/Exceptions.t >+++ b/t/Koha/Exceptions.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 11; > use Test::MockObject; > use Test::Exception; > >@@ -397,3 +397,15 @@ subtest 'Koha::Exception tests' => sub { > 'Exception stringified correctly' > ); > }; >+ >+subtest 'Passing parameters when throwing exception' => sub { >+ plan tests => 4; >+ >+ use Koha::Exceptions; >+ >+ throws_ok { Koha::Exceptions::WrongParameter->throw( name => 'wrong1', type => 'ARRAY', value => [ 1, 2 ] ) } qr/Koha::Exceptions::WrongParameter/, 'Exception thrown'; >+ my $desc = $@; >+ like( $desc, qr/name => wrong1/, 'Found name' ); >+ like( $desc, qr/type => ARRAY/, 'Found type' ); >+ like( $desc, qr/value => ARRAY\(\w+\)/, 'Found value' ); >+}; >-- >2.30.2
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 32334
:
144391
|
144392
|
144393
|
144394
|
146712
|
146713
|
146714
|
146715
|
146716
|
146717
|
146718
|
146719
|
146720
|
148266
|
148299
|
148335
|
148338
|
148339
|
148340
|
148341
|
148342
|
148343
|
148344
|
148345
|
148346
|
148347
|
148348
|
149259
|
149260
|
149261
|
149262
|
149263
|
149264
|
149265
|
149266
|
149267
|
149268
|
149269
|
149270