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

(-)a/t/db_dependent/Items.t (-7 / +8 lines)
Lines 30-35 BEGIN { Link Here
30
}
30
}
31
31
32
my $dbh = C4::Context->dbh;
32
my $dbh = C4::Context->dbh;
33
my $branches = GetBranches;
34
my ($branch1, $branch2) = keys %$branches;
33
35
34
subtest 'General Add, Get and Del tests' => sub {
36
subtest 'General Add, Get and Del tests' => sub {
35
37
Lines 43-49 subtest 'General Add, Get and Del tests' => sub { Link Here
43
    my ($bibnum, $bibitemnum) = get_biblio();
45
    my ($bibnum, $bibitemnum) = get_biblio();
44
46
45
    # Add an item.
47
    # Add an item.
46
    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);
47
    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.");
48
    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.");
49
51
Lines 80-93 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
80
82
81
    # Add two items
83
    # Add two items
82
    my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem(
84
    my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem(
83
            { homebranch => 'CPL',
85
            { homebranch => $branch1,
84
              holdingbranch => 'CPL',
86
              holdingbranch => $branch1,
85
              withdrawn => 1 },
87
              withdrawn => 1 },
86
            $biblionumber
88
            $biblionumber
87
    );
89
    );
88
    my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem(
90
    my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem(
89
            { homebranch => 'MPL',
91
            { homebranch => $branch2,
90
              holdingbranch => 'MPL',
92
              holdingbranch => $branch2,
91
              withdrawn => 0 },
93
              withdrawn => 0 },
92
            $biblionumber
94
            $biblionumber
93
    );
95
    );
Lines 128-134 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
128
    # Two variables, a value each
130
    # Two variables, a value each
129
    $opachiddenitems = "
131
    $opachiddenitems = "
130
        withdrawn: [1]
132
        withdrawn: [1]
131
        homebranch: [MPL]
133
        homebranch: [$branch2]
132
    ";
134
    ";
133
    C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems );
135
    C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems );
134
    @hidden = GetHiddenItemnumbers( @items );
136
    @hidden = GetHiddenItemnumbers( @items );
135
- 

Return to bug 11213