More tests

This commit is contained in:
Xavier Guimard 2016-02-09 12:38:43 +00:00
parent bb710cead0
commit 27048b1670
4 changed files with 42 additions and 8 deletions

View File

@ -60,7 +60,15 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'lmAttrOrMacro' => {
'form' => 'text',
'test' => sub {
1;
my ( $val, $conf ) = @_;
if ( defined $conf->{'exportedVars'}{$val}
or defined $conf->{'macro'}{$val} )
{
return 1;
}
else {
return 1, '__unknownAttrOrMacro__';
}
}
},
'longtext' => {
@ -100,7 +108,9 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
},
'password' => {
'msgFail' => '__malformedValue__',
'test' => qr/.*/
'test' => sub {
1;
}
},
'pcre' => {
'form' => 'text',
@ -196,7 +206,9 @@ qr/^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9\/\+\
},
'text' => {
'msgFail' => '__malformedValue__',
'test' => qr/.*/
'test' => sub {
1;
}
},
'trool' => {
'msgFail' => '__authorizedValues__: -1, 0, 1',
@ -2461,11 +2473,17 @@ qr/^(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.
},
'timeout' => {
'default' => 72000,
'type' => 'int'
'test' => sub {
$_[0] > 0;
},
'type' => 'int'
},
'timeoutActivity' => {
'default' => 0,
'type' => 'int'
'test' => sub {
$_[0] >= 0;
},
'type' => 'int'
},
'trustedDomains' => {
'type' => 'text'

View File

@ -20,11 +20,11 @@ sub types {
# Simple text types
text => {
test => qr/.*/,
test => sub { 1 },
msgFail => '__malformedValue__',
},
password => {
test => qr/.*/,
test => sub { 1 },
msgFail => '__malformedValue__',
},
longtext => {
@ -54,7 +54,17 @@ sub types {
},
lmAttrOrMacro => {
form => 'text',
test => sub { 1 },
test => sub {
my ( $val, $conf ) = @_;
if ( defined $conf->{exportedVars}->{$val}
or defined $conf->{macro}->{$val} )
{
return 1;
}
else {
return ( 1, '__unknownAttrOrMacro__' );
}
},
},
# Other types
@ -427,11 +437,13 @@ sub attributes {
},
timeout => {
type => 'int',
test => sub { $_[0] > 0 },
default => 72000,
documentation => 'Session timeout on server side',
},
timeoutActivity => {
type => 'int',
test => sub { $_[0] >= 0 },
default => 0,
documentation => 'Session activity timeout on server side',
},

View File

@ -56,6 +56,7 @@
"auto": "Automatic",
"backtoportal": "Back to portal",
"badCookieName": "Bad cookie name",
"badCustomFuncName": "Bad custom function name",
"badDomainName": "Bad domain name",
"badEncoding": "Bad encoding",
"badExpression": "Bad expression",
@ -585,6 +586,7 @@
"twitterParams": "Twitter parameters",
"twitterSecret": "API secret",
"uid": "Identifier",
"unknownAttrOrMacro": "Unknown attribute or macro",
"unknownError": "Unknown error",
"unknownKey": "Unknown key",
"unsecuredCookie": "Unsecured cookie",

View File

@ -56,6 +56,7 @@
"auto": "Automatique",
"backtoportal": "Retour au portail",
"badCookieName": "Mauvais nom de cookie",
"badCustomFuncName": "Mauvais nom de fonction personnalisée",
"badDomainName": "Mauvais nom de domaine",
"badEncoding": "Mauvais encodage",
"badExpression": "Mauvaise expression",
@ -585,6 +586,7 @@
"twitterParams": "Paramètres Twitter",
"twitterSecret": "Secret de l'API",
"uid": "Identifiant",
"unknownAttrOrMacro": "Attribut ou macro inconnu",
"unknownError": "Erreur inconnue",
"unknownKey": "Clef inconnue",
"unsecuredCookie": "Cookie non sécurisé",