Bugzilla – Attachment 109819 Details for
Bug 26157
Redirect expected DBI warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26157: Correct two occurrences
Bug-26157-Correct-two-occurrences.patch (text/plain), 2.95 KB, created by
Jonathan Druart
on 2020-09-09 14:32:10 UTC
(
hide
)
Description:
Bug 26157: Correct two occurrences
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-09-09 14:32:10 UTC
Size:
2.95 KB
patch
obsolete
>From 79f04950498d1c756228d7fe60441313cc55079b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 9 Sep 2020 16:31:07 +0200 >Subject: [PATCH] Bug 26157: Correct two occurrences > >We don't want to hide the warnings for all tests >--- > t/db_dependent/Koha/Patron.t | 15 ++++++----- > t/db_dependent/Koha/Patron/Relationship.t | 33 ++++++++++++----------- > 2 files changed, 26 insertions(+), 22 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index d2aff3353c..ffec081dfc 100644 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -64,12 +64,15 @@ subtest 'add_guarantor() tests' => sub { > > is( $guarantors->count, 1, 'No guarantors added' ); > >- $SIG{__WARN__} = sub {}; # FIXME: PrintError = 0 not working! >- >- throws_ok >- { $patron_1->add_guarantor({ guarantor_id => $patron_2->borrowernumber, relationship => 'father2' }); } >- 'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', >- 'Exception is thrown for duplicated relationship'; >+ { >+ local *STDERR; >+ open STDERR, '>', '/dev/null'; >+ throws_ok >+ { $patron_1->add_guarantor({ guarantor_id => $patron_2->borrowernumber, relationship => 'father2' }); } >+ 'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', >+ 'Exception is thrown for duplicated relationship'; >+ close STDERR; >+ } > > $schema->storage->txn_rollback; > }; >diff --git a/t/db_dependent/Koha/Patron/Relationship.t b/t/db_dependent/Koha/Patron/Relationship.t >index 47b51f7190..380aaa2ea6 100644 >--- a/t/db_dependent/Koha/Patron/Relationship.t >+++ b/t/db_dependent/Koha/Patron/Relationship.t >@@ -90,22 +90,23 @@ subtest 'store() tests' => sub { > } > ); > >- $SIG{__WARN__} = sub {}; # FIXME: PrintError = 0 not working! >- >- throws_ok >- { $relationship_2->store; } >- 'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', >- 'Exception is thrown for duplicated relationship'; >- >- is( "$@", >- "There already exists a relationship for the same guarantor (" >- . $patron_2->borrowernumber >- . ") and guarantee (" >- . $patron_1->borrowernumber >- . ") combination", >- 'Exception stringified correctly' >- ); >- >+ { >+ local *STDERR; >+ open STDERR, '>', '/dev/null'; >+ throws_ok >+ { $relationship_2->store; } >+ 'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', >+ 'Exception is thrown for duplicated relationship'; >+ >+ is( "$@", >+ "There already exists a relationship for the same guarantor (" >+ . $patron_2->borrowernumber >+ . ") and guarantee (" >+ . $patron_1->borrowernumber >+ . ") combination", >+ 'Exception stringified correctly' >+ ); >+ } > > $schema->storage->txn_rollback; > }; >-- >2.20.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 26157
:
107874
|
108802
|
108921
| 109819