View | Details | Raw Unified | Return to bug 10519
Collapse All | Expand All

(-)a/t/db_dependent/Suggestions.t (-9 / +30 lines)
Lines 1-27 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
2
#
14
#
3
# This Koha test module is a stub!
15
# You should have received a copy of the GNU General Public License
4
# Add more tests here!!!
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
5
17
6
use strict;
18
use Modern::Perl;
7
use warnings;
8
use Data::Dumper;
9
19
10
use C4::Suggestions;
20
use C4::Suggestions;
11
21
12
use Test::More tests => 13;
22
use Test::More tests => 14;
23
use Test::Warn;
13
24
14
BEGIN {
25
BEGIN {
15
    use_ok('C4::Suggestions');
26
    use_ok('C4::Suggestions');
16
    use_ok('C4::Koha');
27
    use_ok('C4::Koha');
17
}
28
}
18
29
30
my $dbh = C4::Context->dbh;
31
32
# Start transaction
33
$dbh->{AutoCommit} = 0;
34
$dbh->{RaiseError} = 1;
35
19
my ($suggestionid, $suggestion, $status, $biblionumber);
36
my ($suggestionid, $suggestion, $status, $biblionumber);
20
$biblionumber = 1;
37
$biblionumber = 1;
21
ok($suggestionid= NewSuggestion( {title=>'Petit traité de philosohpie',author=>'Hubert de Chardassé',publishercode=>'Albin Michel'} ), "NewSuggestion OK");
38
ok($suggestionid= NewSuggestion( {title=>'Petit traité de philosohpie',author=>'Hubert de Chardassé',publishercode=>'Albin Michel'} ), "NewSuggestion OK");
22
ok($suggestion= GetSuggestion( $suggestionid), "GetSuggestion OK");
39
ok($suggestion= GetSuggestion( $suggestionid), "GetSuggestion OK");
23
ok($status= ModSuggestion( {title=>'test Modif Simple', suggestionid=>$suggestionid} ), "ModSuggestion Simple OK");
40
ok($status= ModSuggestion( {title=>'test Modif Simple', suggestionid=>$suggestionid} ), "ModSuggestion Simple OK");
24
ok($status= ModSuggestion( {STATUS=>'STALLED', suggestionid=>$suggestionid} ), "ModSuggestion Status OK");
41
warning_is { $status = ModSuggestion( {STATUS=>'STALLED', suggestionid=>$suggestionid} )}
42
           "No suggestions STALLED letter transported by email",
43
           "ModSuggestion status warning is correct";
44
ok( $status, "ModSuggestion Status OK");
25
ok($status= ModSuggestion( {suggestionid => $suggestionid, biblionumber => $biblionumber } ), "ModSuggestion, set biblionumber OK" );
45
ok($status= ModSuggestion( {suggestionid => $suggestionid, biblionumber => $biblionumber } ), "ModSuggestion, set biblionumber OK" );
26
ok($suggestion= GetSuggestionFromBiblionumber( $biblionumber ), "GetSuggestionFromBiblionumber OK");
46
ok($suggestion= GetSuggestionFromBiblionumber( $biblionumber ), "GetSuggestionFromBiblionumber OK");
27
ok($suggestion= GetSuggestionInfoFromBiblionumber( $biblionumber ), "GetSuggestionInfoFromBiblionumber OK");
47
ok($suggestion= GetSuggestionInfoFromBiblionumber( $biblionumber ), "GetSuggestionInfoFromBiblionumber OK");
Lines 38-41 ok(scalar @$itemtypes2, "Purchase suggestion itemtypes collected, default Advanc Link Here
38
58
39
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
59
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
40
60
41
##EO Bug 11466
61
$dbh->rollback;
62
63
1;
42
- 

Return to bug 10519