Bugzilla – Attachment 143350 Details for
Bug 31889
Insert 952 tags in correct order when embedding items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31889: (follow-up) Add test for explicit warning
Bug-31889-follow-up-Add-test-for-explicit-warning.patch (text/plain), 1.80 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-11-07 11:31:42 UTC
(
hide
)
Description:
Bug 31889: (follow-up) Add test for explicit warning
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-11-07 11:31:42 UTC
Size:
1.80 KB
patch
obsolete
>From cf5e73033cdd7c41478320b4b213efd94cae626f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 7 Nov 2022 08:29:15 -0300 >Subject: [PATCH] Bug 31889: (follow-up) Add test for explicit warning > >On bug 29697, an explicit call to 'warn' was added, but no tests were >added for that behavior. > >This patch adds that. > >To test: > >1. Run: > $ kshell > k$ prove t/db_dependent/Koha/Biblio/Metadata.t >=> FAIL: There's a warn, no tests for it :-( >2. Apply this patch >3. Repeat 1 >=> SUCCESS: A new test was added, no more warns printed >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Biblio/Metadata.t | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblio/Metadata.t b/t/db_dependent/Koha/Biblio/Metadata.t >index f64bfedb552..d6a5b8b94e5 100755 >--- a/t/db_dependent/Koha/Biblio/Metadata.t >+++ b/t/db_dependent/Koha/Biblio/Metadata.t >@@ -19,6 +19,7 @@ use Modern::Perl; > > use Test::More tests => 3; > use Test::Exception; >+use Test::Warn; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -35,7 +36,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'record() tests' => sub { > >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -60,8 +61,11 @@ subtest 'record() tests' => sub { > } > ); > >- throws_ok { $bad_data->record; } >- 'Koha::Exceptions::Metadata::Invalid', 'Exception thrown on bad record'; >+ warning_like >+ { throws_ok { $bad_data->record; } >+ 'Koha::Exceptions::Metadata::Invalid', 'Exception thrown on bad record'; } >+ qr/parser error : Start tag expected, '<' not found/, >+ 'Warning thrown excplicitly'; > > my $exception = $@; > is( $exception->id, $bad_data->id, 'id passed correctly to exception' ); >-- >2.34.1
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 31889
:
142254
|
142255
|
142256
|
142273
|
142274
|
142275
|
143035
|
143036
|
143037
|
143348
| 143350