Bugzilla – Attachment 44254 Details for
Bug 14836
Move the patron categories related code to Koha::Patron::Categories - part 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14836: Add tests for Koha::Patron::Categor[y|ies]
PASSED-QA-Bug-14836-Add-tests-for-KohaPatronCatego.patch (text/plain), 2.79 KB, created by
Kyle M Hall (khall)
on 2015-10-30 18:58:02 UTC
(
hide
)
Description:
[PASSED QA] Bug 14836: Add tests for Koha::Patron::Categor[y|ies]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-10-30 18:58:02 UTC
Size:
2.79 KB
patch
obsolete
>From 404c67058ab42ff0760e43682d6ce642cd34070e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Oct 2015 09:08:07 +0000 >Subject: [PATCH] [PASSED QA] Bug 14836: Add tests for Koha::Patron::Categor[y|ies] > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Patron/Categories.t | 47 +++++++++++++++++++++++++++++++ > 1 files changed, 47 insertions(+), 0 deletions(-) > create mode 100644 t/db_dependent/Koha/Patron/Categories.t > >diff --git a/t/db_dependent/Koha/Patron/Categories.t b/t/db_dependent/Koha/Patron/Categories.t >new file mode 100644 >index 0000000..9a7e63f >--- /dev/null >+++ b/t/db_dependent/Koha/Patron/Categories.t >@@ -0,0 +1,47 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 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 => 4; >+use Koha::Patron::Category; >+use Koha::Patron::Categories; >+use t::lib::TestBuilder; >+ >+my $builder = t::lib::TestBuilder->new; >+my $branch = $builder->build({ source => 'Branch', }); >+my $nb_of_categories = Koha::Patron::Categories->search->count; >+my $new_category_1 = Koha::Patron::Category->new({ >+ categorycode => 'mycatcodeX', >+ description => 'mycatdescX', >+})->store; >+$new_category_1->add_branch_limitation( $branch->{branchcode} ); >+my $new_category_2 = Koha::Patron::Category->new({ >+ categorycode => 'mycatcodeY', >+ description => 'mycatdescY', >+})->store; >+ >+is( Koha::Patron::Categories->search->count, $nb_of_categories + 2, 'The 2 patron categories should have been added' ); >+ >+my $retrieved_category_1 = Koha::Patron::Categories->find( $new_category_1->categorycode ); >+is( $retrieved_category_1->categorycode, $new_category_1->categorycode, 'Find a patron category by categorycode should return the correct category' ); >+is_deeply( $retrieved_category_1->branch_limitations, [ $branch->{branchcode} ], 'The branch limitation should have been stored and retrieved' ); >+is_deeply( $retrieved_category_1->default_messaging, [], 'By default there is not messaging option' ); >+ >+$retrieved_category_1->delete; >+is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' ); >-- >1.7.2.5
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 14836
:
42616
|
42617
|
44059
|
44060
|
44061
|
44139
|
44140
|
44141
|
44142
|
44250
|
44251
|
44252
|
44253
| 44254 |
44255
|
44519