Bugzilla – Attachment 71986 Details for
Bug 12001
GetMemberAccountRecords slows down display of patron details and checkout pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12001: (QA follow-up) Add test for Koha::Account::Lines object
Bug-12001-QA-follow-up-Add-test-for-KohaAccountLin.patch (text/plain), 2.89 KB, created by
Josef Moravec
on 2018-02-20 05:09:15 UTC
(
hide
)
Description:
Bug 12001: (QA follow-up) Add test for Koha::Account::Lines object
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-02-20 05:09:15 UTC
Size:
2.89 KB
patch
obsolete
>From b4ad7c52c393beb50af4f4012950a90756b403da Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 19 Feb 2018 21:24:32 +0000 >Subject: [PATCH] Bug 12001: (QA follow-up) Add test for Koha::Account::Lines > object > >Test plan >prove t/db_dependent/Koha/Account/Lines.t >--> should be green > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Koha/Account/Lines.t | 65 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 65 insertions(+) > create mode 100755 t/db_dependent/Koha/Account/Lines.t > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >new file mode 100755 >index 0000000..0c3287d >--- /dev/null >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -0,0 +1,65 @@ >+#!/usr/bin/perl >+ >+# Copyright 2018 Koha Development team >+# >+# 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 => 1; >+ >+use Koha::Account::Lines; >+use Koha::Items; >+ >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $builder = t::lib::TestBuilder->new; >+ >+subtest 'item' => sub { >+ plan tests => 2; >+ >+ my $library = $builder->build( { source => 'Branch' } ); >+ my $biblioitem = $builder->build( { source => 'Biblioitem' } ); >+ my $patron = $builder->build( { source => 'Borrower' } ); >+ my $item = Koha::Item->new( >+ { >+ biblionumber => $biblioitem->{biblionumber}, >+ biblioitemnumber => $biblioitem->{biblioitemnumber}, >+ homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, >+ barcode => 'some_barcode_12', >+ itype => 'BK', >+ })->store; >+ >+ my $line = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->{borrowernumber}, >+ itemnumber => $item->itemnumber, >+ accounttype => "F", >+ amount => 10, >+ })->store; >+ >+ my $account_line_item = $line->item; >+ is( ref( $account_line_item ), 'Koha::Item', 'Koha::Account::Line->item should return a Koha::Item' ); >+ is( $line->itemnumber, $account_line_item->itemnumber, 'Koha::Account::Line->item should return the correct item' ); >+}; >+ >+$schema->storage->txn_rollback; >+ >+1; >-- >2.1.4
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 12001
:
70314
|
70342
|
70343
|
70344
|
70345
|
70346
|
71798
|
71799
|
71800
|
71801
|
71802
|
71852
|
71853
|
71854
|
71855
|
71856
|
71857
|
71979
|
71980
|
71981
|
71982
|
71983
|
71984
|
71985
| 71986 |
71987
|
71988
|
77066
|
77136
|
77278
|
77279