|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use utf8; |
20 |
use utf8; |
| 21 |
use Test::More tests => 33; |
21 |
use Test::More; #See plan tests => \d+ below |
| 22 |
use Test::WWW::Mechanize; |
22 |
use Test::WWW::Mechanize; |
| 23 |
use XML::Simple; |
23 |
use XML::Simple; |
| 24 |
use JSON; |
24 |
use JSON; |
|
Lines 35-54
my $testdir = File::Spec->rel2abs( dirname(__FILE__) );
Link Here
|
| 35 |
my $koha_conf = $ENV{KOHA_CONF}; |
35 |
my $koha_conf = $ENV{KOHA_CONF}; |
| 36 |
my $xml = XMLin($koha_conf); |
36 |
my $xml = XMLin($koha_conf); |
| 37 |
|
37 |
|
|
|
38 |
my $user = $ENV{KOHA_USER} || $xml->{config}->{user}; |
| 39 |
my $password = $ENV{KOHA_PASS} || $xml->{config}->{pass}; |
| 40 |
my $intranet = $ENV{KOHA_INTRANET_URL}; |
| 41 |
|
| 38 |
eval{ |
42 |
eval{ |
| 39 |
use C4::Context; |
43 |
use C4::Context; |
| 40 |
}; |
44 |
}; |
| 41 |
if ($@) { |
45 |
if ($@) { |
| 42 |
plan skip_all => "Tests skip. You must have a working Context\n"; |
46 |
plan skip_all => "Tests skip. You must have a working Context\n"; |
| 43 |
} |
47 |
} |
| 44 |
|
48 |
elsif (not defined $intranet) { |
| 45 |
my $user = $ENV{KOHA_USER} || $xml->{config}->{user}; |
|
|
| 46 |
my $password = $ENV{KOHA_PASS} || $xml->{config}->{pass}; |
| 47 |
my $intranet = $ENV{KOHA_INTRANET_URL}; |
| 48 |
|
| 49 |
if (not defined $intranet) { |
| 50 |
plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; |
49 |
plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; |
| 51 |
} |
50 |
} |
|
|
51 |
else { |
| 52 |
plan tests => 33; |
| 53 |
} |
| 52 |
|
54 |
|
| 53 |
my $dbh = C4::Context->dbh; |
55 |
my $dbh = C4::Context->dbh; |
| 54 |
|
56 |
|