unit tests: Try to find templateDir in path
This change makes running the testsuite from an external directory easier. Which is useful if you want to unit test a custom module
This commit is contained in:
parent
f0e90213bb
commit
6a3479ea3c
@ -309,6 +309,7 @@ m@<form.+?action="(?:(?:http://([^/]+))?(/.*?)?|(#))".+method="(post|get)"@is,
|
|||||||
m#<input.+?name="([^"]+)"[^>]+(?:value="([^"]*?)")?#gs,
|
m#<input.+?name="([^"]+)"[^>]+(?:value="([^"]*?)")?#gs,
|
||||||
%fields
|
%fields
|
||||||
);
|
);
|
||||||
|
|
||||||
# Add textarea
|
# Add textarea
|
||||||
%fields = (
|
%fields = (
|
||||||
$res->[2]->[0] =~
|
$res->[2]->[0] =~
|
||||||
@ -610,6 +611,20 @@ use Mouse;
|
|||||||
|
|
||||||
extends 'Lemonldap::NG::Common::PSGI::Cli::Lib';
|
extends 'Lemonldap::NG::Common::PSGI::Cli::Lib';
|
||||||
|
|
||||||
|
# try to find template dir in @INC
|
||||||
|
my $templateDir = "site/templates";
|
||||||
|
unless ( -d $templateDir ) {
|
||||||
|
for (@INC) {
|
||||||
|
if ( -d "$_/site/templates" ) {
|
||||||
|
$templateDir = "$_/site/templates";
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unless ( -d $templateDir ) {
|
||||||
|
die "Could not find template dir";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
our $defaultIni = {
|
our $defaultIni = {
|
||||||
configStorage => {
|
configStorage => {
|
||||||
type => 'File',
|
type => 'File',
|
||||||
@ -624,7 +639,7 @@ our $defaultIni = {
|
|||||||
logLevel => 'error',
|
logLevel => 'error',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
domain => 'example.com',
|
domain => 'example.com',
|
||||||
templateDir => 'site/templates',
|
templateDir => $templateDir,
|
||||||
staticPrefix => '/static',
|
staticPrefix => '/static',
|
||||||
tokenUseGlobalStorage => 0,
|
tokenUseGlobalStorage => 0,
|
||||||
securedCookie => 0,
|
securedCookie => 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user