Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
d17cfd53
Commit
d17cfd53
authored
Dec 01, 2018
by
Christophe Maudoux
🐛
Browse files
Improve unit test (
#1561
)
parent
dc3f179d
Changes
3
Hide whitespace changes
Inline
Side-by-side
lemonldap-ng-manager/t/10-save-unchanged-conf.t
View file @
d17cfd53
...
...
@@ -51,3 +51,6 @@ eval { unlink $confFiles->[1]; rmdir 't/sessions'; };
done_testing
(
count
()
);
# Remove sessions directory
`
rm -rf t/sessions
`;
lemonldap-ng-manager/t/12-save-changed-conf.t
View file @
d17cfd53
...
...
@@ -24,11 +24,11 @@ ok( $res->[0] == 200, "Result code is 200" );
ok
(
$resBody
=
from_json
(
$res
->
[
2
]
->
[
0
]
),
"
Result body contains JSON text
"
);
ok
(
$resBody
->
{
result
}
==
1
,
"
JSON response contains
\"
result:1
\"
"
)
or
print
STDERR
Dumper
(
$resBody
);
ok
(
@
{
$resBody
->
{
details
}
->
{
__warnings__
}
}
==
2
,
"
JSON response contains 2 warnings
"
)
ok
(
@
{
$resBody
->
{
details
}
->
{
'
__warnings__
'
}
}
==
2
,
'
JSON response contains 2 warnings
'
)
or
print
STDERR
Dumper
(
$resBody
);
ok
(
$resBody
->
{
details
}
->
{
__warnings__
}
->
[
0
]
->
{
message
}
=~
/(unprotected|cross-domain-authentication)/
,
"
Warning with 'unprotect' or 'CDA' found
"
)
ok
(
$resBody
->
{
details
}
->
{
'
__warnings__
'
}
->
[
0
]
->
{
message
}
=~
/
\b
(unprotected|cross-domain-authentication)
\b
/
,
"
Warning with 'unprotect' or 'CDA' found
"
)
or
print
STDERR
Dumper
(
$resBody
);
ok
(
$resBody
->
{
details
}
->
{
__warnings__
}
->
[
1
]
->
{
message
}
=~
/(unprotected|cross-domain-authentication)/
,
"
Warning with 'unprotect' or 'CDA' found
"
)
ok
(
$resBody
->
{
details
}
->
{
'
__warnings__
'
}
->
[
1
]
->
{
message
}
=~
/
\b
(unprotected|cross-domain-authentication)
\b
/
,
"
Warning with 'unprotect' or 'CDA' found
"
)
or
print
STDERR
Dumper
(
$resBody
);
ok
(
-
f
$confFiles
->
[
1
],
'
File is created
'
);
count
(
3
);
...
...
@@ -84,9 +84,12 @@ ok( @c2 == 14, '14 keys changed or created in conf 2' )
count
(
5
);
unlink
$confFiles
->
[
1
];
eval
{
rmdir
'
t/sessions
';
};
#
eval { rmdir 't/sessions'; };
done_testing
(
count
()
);
# Remove sessions directory
`
rm -rf t/sessions
`;
sub
changes
{
return
[
{
...
...
lemonldap-ng-manager/t/lemonldap-ng.ini
View file @
d17cfd53
[all]
logLevel
=
error
logLevel
=
error
localSessionStorage
=
localSessionStorageOptions
=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment