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