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

(-)a/t/db_dependent/Items.t (-7 / +9 lines)
Lines 20-25 use Modern::Perl; Link Here
20
20
21
use MARC::Record;
21
use MARC::Record;
22
use C4::Biblio;
22
use C4::Biblio;
23
use C4::Branch;
23
24
24
use Test::More tests => 3;
25
use Test::More tests => 3;
25
26
Lines 28-33 BEGIN { Link Here
28
}
29
}
29
30
30
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
my $branches = GetBranches;
33
my ($branch1, $branch2) = keys %$branches;
31
34
32
subtest 'General Add, Get and Del tests' => sub {
35
subtest 'General Add, Get and Del tests' => sub {
33
36
Lines 42-48 subtest 'General Add, Get and Del tests' => sub { Link Here
42
    my ($bibnum, $bibitemnum) = get_biblio();
45
    my ($bibnum, $bibitemnum) = get_biblio();
43
46
44
    # Add an item.
47
    # Add an item.
45
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum);
48
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch1, holdingbranch => $branch1 } , $bibnum);
46
    cmp_ok($item_bibnum, '==', $bibnum, "New item is linked to correct biblionumber.");
49
    cmp_ok($item_bibnum, '==', $bibnum, "New item is linked to correct biblionumber.");
47
    cmp_ok($item_bibitemnum, '==', $bibitemnum, "New item is linked to correct biblioitemnumber.");
50
    cmp_ok($item_bibitemnum, '==', $bibitemnum, "New item is linked to correct biblioitemnumber.");
48
51
Lines 79-92 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
79
82
80
    # Add two items
83
    # Add two items
81
    my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem(
84
    my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem(
82
            { homebranch => 'CPL',
85
            { homebranch => $branch1,
83
              holdingbranch => 'CPL',
86
              holdingbranch => $branch1,
84
              withdrawn => 1 },
87
              withdrawn => 1 },
85
            $biblionumber
88
            $biblionumber
86
    );
89
    );
87
    my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem(
90
    my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem(
88
            { homebranch => 'MPL',
91
            { homebranch => $branch2,
89
              holdingbranch => 'MPL',
92
              holdingbranch => $branch2,
90
              withdrawn => 0 },
93
              withdrawn => 0 },
91
            $biblionumber
94
            $biblionumber
92
    );
95
    );
Lines 127-133 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
127
    # Two variables, a value each
130
    # Two variables, a value each
128
    $opachiddenitems = "
131
    $opachiddenitems = "
129
        withdrawn: [1]
132
        withdrawn: [1]
130
        homebranch: [MPL]
133
        homebranch: [$branch2]
131
    ";
134
    ";
132
    C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems );
135
    C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems );
133
    @hidden = GetHiddenItemnumbers( @items );
136
    @hidden = GetHiddenItemnumbers( @items );
134
- 

Return to bug 11213