+$dbh->do(q|DELETE FROM suggestions|);
+$dbh->do(q|DELETE FROM borrowers|);
+$dbh->do(q|DELETE FROM letter|);
+$dbh->do(q|DELETE FROM message_queue|);
+$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|);
+
+my $borrowernumber = AddMember(
+ firstname => 'my firstname',
+ surname => 'my surname',
+ categorycode => 'S',
+ branchcode => 'CPL',
+);
+
+my $my_suggestion = {
+ title => 'my title',
+ author => 'my author',
+ publishercode => 'my publishercode',
+ suggestedby => $borrowernumber,
+ biblionumber => 1,
+};
+my $my_suggestionid = NewSuggestion($my_suggestion);
+isnt( $my_suggestionid, 0, 'NewSuggestion returns an not null id' );
+my $suggestion = GetSuggestion($my_suggestionid);
+is( $suggestion->{title}, $my_suggestion->{title}, 'NewSuggestion stores the title correctly' );
+is( $suggestion->{author}, $my_suggestion->{author}, 'NewSuggestion stores the author correctly' );
+is( $suggestion->{publishercode}, $my_suggestion->{publishercode}, 'NewSuggestion stores the publishercode correctly' );
+is( $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, 'NewSuggestion stores the borrower number correctly' );
+is( $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, 'NewSuggestion stores the biblio number correctly' );
+is( $suggestion->{STATUS}, 'ASKED', 'NewSuggestion stores a suggestion with the status ASKED by default' );
+$suggestion = GetSuggestion();
+is( $suggestion, undef, 'GetSuggestion without the suggestion id returns undef' );
+
+
+my $status = ModSuggestion();
+is( $status, undef, 'ModSuggestion without arguments returns undef' );
+
+my $mod_suggestion1 = {
+ title => 'my modified title',
+ author => 'my modified author',
+ publishercode => 'my modified publishercode',
+};
+$status = ModSuggestion($mod_suggestion1);
+is( $status, '0E0', 'ModSuggestion without the suggestion id returns 0E0' );
+
+$mod_suggestion1->{suggestionid} = $my_suggestionid;
+$status = ModSuggestion($mod_suggestion1);
+is( $status, 1, 'ModSuggestion modifies one entry' );
+$suggestion = GetSuggestion($my_suggestionid);
+is( $suggestion->{title}, $mod_suggestion1->{title}, 'ModSuggestion modifies the title correctly' );
+is( $suggestion->{author}, $mod_suggestion1->{author}, 'ModSuggestion modifies the author correctly' );
+is( $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, 'ModSuggestion modifies the publishercode correctly' );
+my $messages = C4::Letters::GetQueuedMessages({
+ borrowernumber => $borrowernumber,
+});
+is( @$messages, 0, 'ModSuggestions does not send an email if the status is not updated' );
+
+my $mod_suggestion2 = {
+ STATUS => 'STALLED',
+ suggestionid => $my_suggestionid,
+};
+warning_is { $status = ModSuggestion($mod_suggestion2) }