Bugzilla – Attachment 87058 Details for
Bug 22577
Cronjobs (and other scripts) should be attributed to a 'real' user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22577: Test patron delete restriction
Bug-22577-Test-patron-delete-restriction.patch (text/plain), 1.45 KB, created by
Martin Renvoize (ashimema)
on 2019-03-27 10:31:32 UTC
(
hide
)
Description:
Bug 22577: Test patron delete restriction
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-03-27 10:31:32 UTC
Size:
1.45 KB
patch
obsolete
>From 34828750b98c991baca6d744a1e9ddc6468259b5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 27 Mar 2019 06:53:44 +0000 >Subject: [PATCH] Bug 22577: Test patron delete restriction > >--- > Koha/Patron.pm | 2 +- > t/db_dependent/Koha/Patrons.t | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 33056d7483..65a7e53281 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -318,7 +318,7 @@ sub delete { > my ($self) = @_; > > unless ( $self->borrowernumber > 0 ) { >- Koha::Exceptions::CannotDeleteDefault->throw( >+ Koha::Exceptions::Patron::FailedDelete->throw( > { message => "Cannot delete system user" } ); > } > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index baaa07511c..a0a46ec2eb 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -395,6 +395,8 @@ subtest "delete" => sub { > > my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'DELETE', object => $retrieved_patron->borrowernumber } )->count; > is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->delete should have logged' ); >+ my $system_patron = Koha::Patrons->find('-1'); >+ throws_ok { $system_patron->delete } 'Koha::Exceptions::Patron::FailedDelete', 'Exception raised for deleting system patron'; > }; > > subtest 'Koha::Patrons->delete' => sub { >-- >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 22577
:
86991
|
86992
|
86993
|
87007
|
87008
|
87013
|
87014
|
87015
|
87017
|
87028
|
87029
|
87030
|
87031
|
87032
|
87053
|
87054
|
87055
|
87056
|
87057
| 87058 |
87059
|
87060