|
Lines 17-27
my $dbh = C4::Context->dbh;
Link Here
|
| 17 |
$dbh->{AutoCommit} = 0; |
17 |
$dbh->{AutoCommit} = 0; |
| 18 |
$dbh->{RaiseError} = 1; |
18 |
$dbh->{RaiseError} = 1; |
| 19 |
|
19 |
|
| 20 |
# this test assumes a CPL branch |
|
|
| 21 |
my $builder = t::lib::TestBuilder->new; |
20 |
my $builder = t::lib::TestBuilder->new; |
| 22 |
if( !$builder->schema->resultset('Branch')->find('CPL') ) { |
21 |
|
| 23 |
$builder->build( { source => 'Branch', value => { branchcode => 'CPL' }}); |
22 |
# create two branches |
| 24 |
} |
23 |
my $library = $builder->build( { source => 'Branch' })->{branchcode}; |
|
|
24 |
my $library2 = $builder->build( { source => 'Branch' })->{branchcode}; |
| 25 |
|
25 |
|
| 26 |
$dbh->do(q| |
26 |
$dbh->do(q| |
| 27 |
DELETE FROM marc_subfield_structure |
27 |
DELETE FROM marc_subfield_structure |
|
Lines 44-51
my ($biblionumber, undef) = C4::Biblio::AddBiblio($record, '');
Link Here
|
| 44 |
|
44 |
|
| 45 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) = C4::Items::AddItem( |
45 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) = C4::Items::AddItem( |
| 46 |
{ |
46 |
{ |
| 47 |
homebranch => 'CPL', |
47 |
homebranch => $library, |
| 48 |
holdingbranch => 'CPL', |
48 |
holdingbranch => $library, |
| 49 |
new_status => 'new_value', |
49 |
new_status => 'new_value', |
| 50 |
ccode => 'FIC', |
50 |
ccode => 'FIC', |
| 51 |
}, |
51 |
}, |
|
Lines 194-200
is( $marc_item->subfield($tagfield, $new_tagfield), undef, q|ToggleNewStatus: Th
Link Here
|
| 194 |
}, |
194 |
}, |
| 195 |
{ |
195 |
{ |
| 196 |
field => 'items.homebranch', |
196 |
field => 'items.homebranch', |
| 197 |
value => 'CPL', |
197 |
value => $library, |
| 198 |
}, |
198 |
}, |
| 199 |
], |
199 |
], |
| 200 |
substitutions => [ |
200 |
substitutions => [ |
|
Lines 248-254
is( $modified_item->{new_status}, 'new_value', q|ToggleNewStatus: conditions mul
Link Here
|
| 248 |
}, |
248 |
}, |
| 249 |
{ |
249 |
{ |
| 250 |
field => 'items.homebranch', |
250 |
field => 'items.homebranch', |
| 251 |
value => 'MPL|CPL', |
251 |
value => "$library|$library2", |
| 252 |
}, |
252 |
}, |
| 253 |
], |
253 |
], |
| 254 |
substitutions => [ |
254 |
substitutions => [ |
| 255 |
- |
|
|