Lines 126-134
subtest "Absolute path change in _get_template_file" => sub {
Link Here
|
126 |
# We create a simple template in /tmp. |
126 |
# We create a simple template in /tmp. |
127 |
# We simulate an anonymous OPAC session; the OPACBaseURL template variable |
127 |
# We simulate an anonymous OPAC session; the OPACBaseURL template variable |
128 |
# should be filled by get_template_and_user. |
128 |
# should be filled by get_template_and_user. |
129 |
t::lib::Mocks::mock_config( 'pluginsdir', [ Koha::UploadedFile->temporary_directory ] ); |
129 |
t::lib::Mocks::mock_config( 'pluginsdir', [ C4::Context::temporary_directory ] ); |
130 |
t::lib::Mocks::mock_preference( 'OPACBaseURL', 'without any doubt' ); |
130 |
t::lib::Mocks::mock_preference( 'OPACBaseURL', 'without any doubt' ); |
131 |
my ( $fh, $fn ) = tempfile( SUFFIX => '.tt', UNLINK => 1, DIR => Koha::UploadedFile->temporary_directory ); |
131 |
my ( $fh, $fn ) = tempfile( SUFFIX => '.tt', UNLINK => 1, DIR => C4::Context::temporary_directory ); |
132 |
print $fh q|I am a [% quality %] template [% OPACBaseURL %]|; |
132 |
print $fh q|I am a [% quality %] template [% OPACBaseURL %]|; |
133 |
close $fh; |
133 |
close $fh; |
134 |
my ( $template, $login, $cookie ) = C4::Auth::get_template_and_user({ |
134 |
my ( $template, $login, $cookie ) = C4::Auth::get_template_and_user({ |