Lines 18-23
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 53; |
20 |
use Test::More tests => 53; |
|
|
21 |
use Test::MockModule; |
21 |
|
22 |
|
22 |
use MARC::Record; |
23 |
use MARC::Record; |
23 |
use DateTime::Duration; |
24 |
use DateTime::Duration; |
Lines 37-45
BEGIN {
Link Here
|
37 |
} |
38 |
} |
38 |
|
39 |
|
39 |
# a very minimal mack of userenv for use by the test of DelItemCheck |
40 |
# a very minimal mack of userenv for use by the test of DelItemCheck |
40 |
*C4::Context::userenv = sub { |
41 |
my $c4_context = Test::MockModule->new('C4::Context'); |
41 |
return {}; |
42 |
$c4_context->mock('userenv', sub { return { flags => 1 } }); |
42 |
}; |
|
|
43 |
|
43 |
|
44 |
my $dbh = C4::Context->dbh; |
44 |
my $dbh = C4::Context->dbh; |
45 |
|
45 |
|
Lines 48-54
$dbh->{AutoCommit} = 0;
Link Here
|
48 |
$dbh->{RaiseError} = 1; |
48 |
$dbh->{RaiseError} = 1; |
49 |
|
49 |
|
50 |
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached |
50 |
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached |
51 |
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a'"); |
51 |
$dbh->do(q| |
|
|
52 |
INSERT INTO marc_subfield_structure (frameworkcode, tagfield, tagsubfield, kohafield) |
53 |
VALUES ('', '521', 'a', 'biblioitems.agerestriction') |
54 |
ON DUPLICATE KEY UPDATE kohafield = VALUES(kohafield) |
55 |
|); |
52 |
|
56 |
|
53 |
# Setup Test------------------------ |
57 |
# Setup Test------------------------ |
54 |
|
58 |
|
55 |
- |
|
|