Bugzilla – Attachment 62093 Details for
Bug 18420
Some tests fail without patron category 'S'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18420: Use TestBuilder to create a patron category in Suggestions.t
Bug-18420-Use-TestBuilder-to-create-a-patron-categ.patch (text/plain), 2.06 KB, created by
Jonathan Druart
on 2017-04-12 14:15:28 UTC
(
hide
)
Description:
Bug 18420: Use TestBuilder to create a patron category in Suggestions.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-12 14:15:28 UTC
Size:
2.06 KB
patch
obsolete
>From 147fcdc0f567151fd7e740ec80820833b62c2bf5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 11 Apr 2017 07:33:32 -0300 >Subject: [PATCH] Bug 18420: Use TestBuilder to create a patron category in > Suggestions.t > >No need to do it that way, let's use TestBuilder. > >Test plan: > prove t/db_dependent/Suggestions.t >should still return green >--- > t/db_dependent/Suggestions.t | 19 +++++-------------- > 1 file changed, 5 insertions(+), 14 deletions(-) > >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 63f390e..6eb7575 100644 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -27,6 +27,8 @@ use Koha::DateUtils qw( dt_from_string ); > use Koha::Library; > use Koha::Libraries; > >+use t::lib::TestBuilder; >+ > use DateTime::Duration; > use Test::More tests => 102; > use Test::Warn; >@@ -42,6 +44,7 @@ my $sql; > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > >+my $builder = t::lib::TestBuilder->new; > # Reset item types to only the default ones > $dbh->do(q|DELETE FROM itemtypes;|); > $sql = " >@@ -67,24 +70,12 @@ if (not defined Koha::Libraries->find('CPL')) { > Koha::Library->new({ branchcode => 'CPL', branchname => 'Centerville' })->store; > } > >-my $sth = $dbh->prepare("SELECT * FROM categories WHERE categorycode='S';"); >-$sth->execute(); >-if (!$sth->fetchrow_hashref) { >- $sql = "INSERT INTO categories >- (categorycode,description,enrolmentperiod,upperagelimit, >- dateofbirthrequired,finetype,bulk,enrolmentfee, >- overduenoticerequired,issuelimit,reservefee,category_type) >- VALUES >- ('S','Staff',99,999, >- 18,NULL,NULL,'0.000000', >- 0,NULL,'0.000000','S');"; >- $dbh->do($sql); >-} >+my $patron_category = $builder->build({ source => 'Category' }); > > my $member = { > firstname => 'my firstname', > surname => 'my surname', >- categorycode => 'S', >+ categorycode => $patron_category->{categorycode}, > branchcode => 'CPL', > }; > my $borrowernumber = AddMember(%$member); >-- >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 18420
:
62090
|
62091
|
62092
|
62093
|
62095
|
62115
|
62118
|
62164
|
62174
|
62175
|
62176
|
62177
|
62178
|
62179
|
62180
|
62274
|
62275
|
62276
|
62277
|
62278
|
62279
|
62280
|
112053