Bugzilla – Attachment 52803 Details for
Bug 12178
Serial claims: exporting late issues with the CSV profile doesn't set the issue claimed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12178: Fix tests not to depend on dateformat syspref
Bug-12178-Fix-tests-not-to-depend-on-dateformat-sy.patch (text/plain), 3.57 KB, created by
Kyle M Hall
on 2016-06-24 14:17:54 UTC
(
hide
)
Description:
Bug 12178: Fix tests not to depend on dateformat syspref
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2016-06-24 14:17:54 UTC
Size:
3.57 KB
patch
obsolete
>From 6a0db2da3cf063d6c7801ce9f09778ba1df4c04e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Jun 2016 12:31:40 +0100 >Subject: [PATCH] Bug 12178: Fix tests not to depend on dateformat syspref > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Serials.t | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 1d6da06..e09a076 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -15,6 +15,7 @@ use C4::Bookseller; > use C4::Biblio; > use C4::Budgets; > use Koha::DateUtils; >+use t::lib::Mocks; > use Test::More tests => 48; > > BEGIN { >@@ -188,6 +189,7 @@ is(C4::Serials::GetLateOrMissingIssues(), undef, 'test getting last or missing i > subtest 'test_updateClaim' => sub { > plan tests => 11; > >+ my $today = output_pref({ dt => dt_from_string, dateonly => 1 }); > # Given ... nothing much > # When ... Then ... > my $result_0 = C4::Serials::updateClaim(undef); >@@ -195,7 +197,7 @@ subtest 'test_updateClaim' => sub { > > # Given ... 3 serial. 2 of them updated. > my $serialids_1 = [90980, 90981]; >- my $claimdate_1 = '2001/01/13'; # arbitrary date some time in the past. >+ my $claimdate_1 = dt_from_string('2001-01-13'); # arbitrary date some time in the past. > my $claim_count_1 = 5; > Koha::Serial->new( { serialid => $serialids_1->[0], serialseq => 'serialseq', subscriptionid => $subscriptionid, status => 3, > biblionumber => 12345, claimdate => $claimdate_1, claims_count => $claim_count_1, } )->store(); >@@ -211,17 +213,17 @@ subtest 'test_updateClaim' => sub { > is($result_1, 2, 'Got the expected 2 from update claim with 2 serial ids'); > > my @late_or_missing_issues_1_0 = C4::Serials::GetLateOrMissingIssues(undef, $serialids_1->[0]); >- isnt($late_or_missing_issues_1_0[0]->{claimdate}, $claimdate_1, 'Got the expected first different claim date from update claim'); >+ is($late_or_missing_issues_1_0[0]->{claimdate}, $today, 'Got the expected first different claim date from update claim'); > is($late_or_missing_issues_1_0[0]->{claims_count}, $claim_count_1+1, 'Got the expected first claim count from update claim'); > is($late_or_missing_issues_1_0[0]->{status}, 7, 'Got the expected first claim status from update claim'); > > my @late_or_missing_issues_1_1 = C4::Serials::GetLateOrMissingIssues(undef, $serialids_1->[1]); >- isnt($late_or_missing_issues_1_1[0]->{claimdate}, $claimdate_1, 'Got the expected second different claim date from update claim'); >+ is($late_or_missing_issues_1_1[0]->{claimdate}, $today, 'Got the expected second different claim date from update claim'); > is($late_or_missing_issues_1_1[0]->{claims_count}, $claim_count_1+1, 'Got the expected second claim count from update claim'); > is($late_or_missing_issues_1_1[0]->{status}, 7, 'Got the expected second claim status from update claim'); > > my @late_or_missing_issues_1_2 = C4::Serials::GetLateOrMissingIssues(undef, 90982); >- is($late_or_missing_issues_1_2[0]->{claimdate}, '13/01/2001', 'Got the expected unchanged claim date from update claim'); >+ is($late_or_missing_issues_1_2[0]->{claimdate}, output_pref({ dt => $claimdate_1, dateonly => 1}), 'Got the expected unchanged claim date from update claim'); > is($late_or_missing_issues_1_2[0]->{claims_count}, $claim_count_1, 'Got the expected unchanged claim count from update claim'); > is($late_or_missing_issues_1_2[0]->{status}, 3, 'Got the expected unchanged claim status from update claim'); > }; >-- >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 12178
:
38607
|
45983
|
49559
|
51732
|
52637
|
52638
|
52639
|
52801
|
52802
| 52803