|
Lines 49-55
my $new_suggestion_2 = Koha::Suggestion->new(
Link Here
|
| 49 |
)->store; |
49 |
)->store; |
| 50 |
|
50 |
|
| 51 |
subtest 'store' => sub { |
51 |
subtest 'store' => sub { |
| 52 |
plan tests => 3; |
52 |
plan tests => 5; |
| 53 |
my $suggestion = Koha::Suggestion->new( |
53 |
my $suggestion = Koha::Suggestion->new( |
| 54 |
{ suggestedby => $patron->{borrowernumber}, |
54 |
{ suggestedby => $patron->{borrowernumber}, |
| 55 |
biblionumber => $biblio_1->biblionumber, |
55 |
biblionumber => $biblio_1->biblionumber, |
|
Lines 65-70
subtest 'store' => sub {
Link Here
|
| 65 |
$suggestion->reason('because!')->store; |
65 |
$suggestion->reason('because!')->store; |
| 66 |
$suggestion = Koha::Suggestions->find( $suggestion->suggestionid ); |
66 |
$suggestion = Koha::Suggestions->find( $suggestion->suggestionid ); |
| 67 |
is( $suggestion->suggesteddate, $two_days_ago_sql, 'If suggestion id modified, suggesteddate should not be modified' ); |
67 |
is( $suggestion->suggesteddate, $two_days_ago_sql, 'If suggestion id modified, suggesteddate should not be modified' ); |
|
|
68 |
|
| 69 |
throws_ok { |
| 70 |
$suggestion->STATUS('UNKNOWN')->store; |
| 71 |
} |
| 72 |
'Koha::Exceptions::Suggestion::StatusForbidden', |
| 73 |
'store raises an exception on invalid STATUS'; |
| 74 |
|
| 75 |
my $authorised_value = Koha::AuthorisedValue->new( |
| 76 |
{ |
| 77 |
category => 'SUGGEST_STATUS', |
| 78 |
authorised_value => 'UNKNOWN' |
| 79 |
} |
| 80 |
)->store; |
| 81 |
$suggestion->STATUS('UNKNOWN')->store; |
| 82 |
is( $suggestion->STATUS, 'UNKNOWN', "UNKNOWN status stored" ); |
| 68 |
$suggestion->delete; |
83 |
$suggestion->delete; |
| 69 |
}; |
84 |
}; |
| 70 |
|
85 |
|
| 71 |
- |
|
|