Bug 15270: Add regression tests for Koha::Objects->find
Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
parent
4f3af04623
commit
7747465976
|
|
@ -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' );
|
||||
Loading…
Reference in New Issue