Bugzilla – Attachment 45255 Details for
Bug 15270
Koha::Objects->find can exploded if searching for nonexistent record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15270: Add regression tests for Koha::Objects->find
Bug-15270-Add-regression-tests-for-KohaObjects-fin.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2015-12-01 10:17:52 UTC
(
hide
)
Description:
Bug 15270: Add regression tests for Koha::Objects->find
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-01 10:17:52 UTC
Size:
1.67 KB
patch
obsolete
>From 8951033f3ba26db0250f20ad9df35415f07513bd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 1 Dec 2015 10:17:11 +0000 >Subject: [PATCH] Bug 15270: Add regression tests for Koha::Objects->find > >--- > t/db_dependent/Objects.t | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > create mode 100644 t/db_dependent/Objects.t > >diff --git a/t/db_dependent/Objects.t b/t/db_dependent/Objects.t >new file mode 100644 >index 0000000..ab86a13 >--- /dev/null >+++ b/t/db_dependent/Objects.t >@@ -0,0 +1,29 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 2; >+use t::lib::TestBuilder; >+use Koha::Database; >+use Koha::Borrowers; >+my $builder = t::lib::TestBuilder->new; >+ >+my $patron = $builder->build( { source => 'Borrower' } ); >+is( Koha::Borrowers->find( $patron->{borrowernumber} )->delete, 1, 'The patron has correctly been deleted' ); >+ >+is( Koha::Borrowers->find( $patron->{borrowernumber} ), undef, 'Koha::Objects->find should not crash if the object does not exist' ); >-- >2.1.0
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 15270
:
45254
|
45255
|
45256
|
45262
|
45263
|
45438
|
45439