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