Bugzilla – Attachment 72107 Details for
Bug 13287
Add a system preference to define the number of days used in purge_suggestions.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13287: (QA follow-up) Prepare Suggestions.t for changes
Bug-13287-QA-follow-up-Prepare-Suggestionst-for-ch.patch (text/plain), 2.55 KB, created by
Marcel de Rooy
on 2018-02-23 10:45:01 UTC
(
hide
)
Description:
Bug 13287: (QA follow-up) Prepare Suggestions.t for changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-02-23 10:45:01 UTC
Size:
2.55 KB
patch
obsolete
>From 0122605e6606eaf22c787a276505db7e83316036 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 23 Feb 2018 09:15:55 +0100 >Subject: [PATCH] Bug 13287: (QA follow-up) Prepare Suggestions.t for changes >Content-Type: text/plain; charset=utf-8 > >Just rearranging some modules here. >Adding Koha::Database and schema calls. > >Test plan: >Run t/db_dependent/Suggestions.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Suggestions.t | 29 ++++++++++++++--------------- > 1 file changed, 14 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 6eb7575..5e9e5ed 100644 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -17,37 +17,34 @@ > > use Modern::Perl; > >+use DateTime::Duration; >+use Test::More tests => 102; >+use Test::Warn; >+ > use t::lib::Mocks; >+use t::lib::TestBuilder; >+ > use C4::Context; > use C4::Members; > use C4::Letters; > use C4::Budgets qw( AddBudgetPeriod AddBudget ); >- >+use Koha::Database; > 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; >- > BEGIN { > use_ok('C4::Suggestions'); > } > >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; > my $dbh = C4::Context->dbh; >-my $sql; >- >-# Start transaction >-$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 = " >+my $sql = qq| > INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl, summary) VALUES > ('BK', 'Books',5,0,'bridge/book.gif',''), > ('MX', 'Mixed Materials',5,0,'bridge/kit.gif',''), >@@ -56,7 +53,7 @@ INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl > ('VM', 'Visual Materials',5,1,'bridge/dvd.gif',''), > ('MU', 'Music',5,0,'bridge/sound.gif',''), > ('CR', 'Continuing Resources',5,0,'bridge/periodical.gif',''), >-('REF', 'Reference',0,1,'bridge/reference.gif','');"; >+('REF', 'Reference',0,1,'bridge/reference.gif','');|; > $dbh->do($sql); > $dbh->do(q|DELETE FROM suggestions|); > $dbh->do(q|DELETE FROM issues|); >@@ -384,3 +381,5 @@ subtest 'GetUnprocessedSuggestions' => sub { > $unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions(5); > is( scalar(@$unprocessed_suggestions), 0, 'GetUnprocessedSuggestions should not return the suggestion, it has not been suggested 5 days ago' ); > }; >+ >+$schema->storage->txn_rollback; >-- >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 13287
:
33661
|
41219
|
44312
|
48323
|
48324
|
50296
|
50297
|
60569
|
60570
|
68187
|
69142
|
69143
|
72105
|
72106
| 72107 |
72108
|
72109
|
72217