Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use C4::Context; |
20 |
use C4::Context; |
21 |
|
21 |
|
22 |
use Test::More tests => 5; |
22 |
use Test::More tests => 6; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
|
24 |
|
25 |
use C4::Context; |
25 |
use C4::Context; |
Lines 49-54
my $AudioAlerts_value = C4::Context->preference('AudioAlerts');
Link Here
|
49 |
C4::Context->set_preference('AudioAlerts', '1'); |
49 |
C4::Context->set_preference('AudioAlerts', '1'); |
50 |
|
50 |
|
51 |
our @cleanup; |
51 |
our @cleanup; |
|
|
52 |
|
53 |
subtest 'SCI can load error pages' => sub { |
54 |
plan tests => 1; |
55 |
|
56 |
my $builder = t::lib::TestBuilder->new; |
57 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }}); |
58 |
t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); |
59 |
my $password = Koha::AuthUtils::generate_password(); |
60 |
$patron->set_password({ password => $password }); |
61 |
|
62 |
my $dbh = C4::Context->dbh(); |
63 |
my $sth = $dbh->prepare("INSERT INTO user_permissions (borrowernumber, module_bit, code) VALUES ( ?, 23,'self_checkin_module')"); |
64 |
$sth->execute($patron->borrowernumber); |
65 |
|
66 |
my $sci_mo = C4::Context->preference('SelfCheckInModule'); |
67 |
my $sci_js = C4::Context->preference('SelfCheckInUserJS'); |
68 |
C4::Context->set_preference('SelfCheckInUserJS','</script><img src="'.$s->opac_base_url.'/silk/famfamfam.png"/><script>'); |
69 |
C4::Context->set_preference('SelfCheckInModule','1'); |
70 |
|
71 |
my $sci_module = $s->opac_base_url . qq|sci/sci-main.pl|; |
72 |
$driver->get($sci_module); |
73 |
$s->fill_form( { userid => $patron->userid, password => $password } ); |
74 |
$s->submit_form(); |
75 |
$driver->get($sci_module); |
76 |
like( $driver->get_title(), qr(Self check-in), ); |
77 |
|
78 |
C4::Context->set_preference('SelfCheckInUserJS',$sci_js); |
79 |
C4::Context->set_preference('SelfCheckInModule',$sci_mo); |
80 |
push @cleanup, $patron, $patron->category, $patron->library; |
81 |
}; |
52 |
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { |
82 |
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { |
53 |
plan tests => 2; |
83 |
plan tests => 2; |
54 |
|
84 |
|
55 |
- |
|
|