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

(-)a/t/db_dependent/Items.t (-15 / +14 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 );
Lines 151-173 subtest 'GetItemsInfo tests' => sub { Link Here
151
    $dbh->{AutoCommit} = 0;
153
    $dbh->{AutoCommit} = 0;
152
    $dbh->{RaiseError} = 1;
154
    $dbh->{RaiseError} = 1;
153
155
154
    my $homebranch    = 'CPL';
155
    my $holdingbranch = 'MPL';
156
157
    # Add a biblio
156
    # Add a biblio
158
    my $biblionumber = get_biblio();
157
    my ($biblionumber, $biblioitemnumber) = get_biblio();
158
159
    # Add an item
159
    # Add an item
160
    my ($item_bibnum, $item_bibitemnum, $itemnumber)
160
    my ($item_bibnum, $item_bibitemnum, $itemnumber)
161
        = AddItem({
161
        = AddItem({
162
                homebranch    => $homebranch,
162
                homebranch    => $branch1,
163
                holdingbranch => $holdingbranch
163
                holdingbranch => $branch2
164
            }, $biblionumber );
164
            }, $biblionumber );
165
165
166
    my $branch = GetBranchDetail( $homebranch );
166
    my $branch = GetBranchDetail( $branch1 );
167
    $branch->{ opac_info } = "homebranch OPAC info";
167
    $branch->{ opac_info } = "homebranch OPAC info";
168
    ModBranch($branch);
168
    ModBranch($branch);
169
169
170
    $branch = GetBranchDetail( $holdingbranch );
170
    $branch = GetBranchDetail( $branch2 );
171
    $branch->{ opac_info } = "holdingbranch OPAC info";
171
    $branch->{ opac_info } = "holdingbranch OPAC info";
172
    ModBranch($branch);
172
    ModBranch($branch);
173
173
174
- 

Return to bug 5304