Bugzilla – Attachment 102582 Details for
Bug 22778
Suggestions with no "suggester" can cause errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22778: Add unit test
Bug-22778-Add-unit-test.patch (text/plain), 2.31 KB, created by
Kyle M Hall (khall)
on 2020-04-08 15:05:55 UTC
(
hide
)
Description:
Bug 22778: Add unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-04-08 15:05:55 UTC
Size:
2.31 KB
patch
obsolete
>From 85b60f93125488bc6adfa36221684ee4e1629afb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 8 Apr 2020 10:52:23 -0400 >Subject: [PATCH] Bug 22778: Add unit test > >--- > t/db_dependent/Suggestions.t | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 0349353d02..4839246ed7 100644 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use DateTime::Duration; >-use Test::More tests => 113; >+use Test::More tests => 114; > use Test::Warn; > > use t::lib::Mocks; >@@ -145,6 +145,19 @@ my $my_suggestion_with_budget2 = { > note => 'my note', > budgetid => $budget_id, > }; >+my $my_suggestion_without_suggestedby = { >+ title => 'my title', >+ author => 'my author', >+ publishercode => 'my publishercode', >+ suggestedby => undef, >+ biblionumber => $biblio_1->biblionumber, >+ branchcode => 'CPL', >+ managedby => '', >+ manageddate => '', >+ accepteddate => dt_from_string, >+ note => 'my note', >+ quantity => '', # Insert an empty string into int to catch strict SQL modes errors >+}; > > is( CountSuggestion(), 0, 'CountSuggestion without the status returns 0' ); > is( CountSuggestion('ASKED'), 0, 'CountSuggestion returns the correct number of suggestions' ); >@@ -627,4 +640,24 @@ subtest 'EmailPurchaseSuggestions' => sub { > 'suggestions@b.c', 'EmailAddressForSuggestions uses EmailAddressForSuggestions when set' ); > }; > >+subtest 'ModSuggestion should work on suggestions without a suggestor' => sub { >+ plan tests => 2; >+ >+ $dbh->do(q|DELETE FROM suggestions|); >+ my $my_suggestionid = NewSuggestion($my_suggestion_without_suggestedby); >+ $suggestion = GetSuggestion($my_suggestionid); >+ is( $suggestion->{suggestedby}, undef, "Suggestedby is undef" ); >+ >+ ModSuggestion( >+ { >+ suggestionid => $my_suggestionid, >+ STATUS => 'CHECKED', >+ note => "Test note" >+ } >+ ); >+ $suggestion = GetSuggestion($my_suggestionid); >+ >+ is( $suggestion->{note}, "Test note", "ModSuggestion works on suggestions without a suggestor" ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.24.1 (Apple Git-126)
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 22778
:
88816
|
102229
|
102426
|
102581
|
102582
|
102611
|
102612