From 5e8effcddd33691b33bc1f38aa8fe0e9e6d45b0f Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 2 Jan 2021 17:46:16 +0100 Subject: [PATCH] Test token (#1976) --- .../t/68-FindUser-with-Demo-and-token.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lemonldap-ng-portal/t/68-FindUser-with-Demo-and-token.t b/lemonldap-ng-portal/t/68-FindUser-with-Demo-and-token.t index 75ec62491..3eb75468b 100644 --- a/lemonldap-ng-portal/t/68-FindUser-with-Demo-and-token.t +++ b/lemonldap-ng-portal/t/68-FindUser-with-Demo-and-token.t @@ -30,7 +30,15 @@ my ( $host, $url, $query ) = expectForm( $res, '#', undef, 'user', 'password', 'spoofId', 'token' ); ( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'token' ); -count(1); +ok( + $res->[2]->[0] =~ + m%%, + 'Token value found' +) or explain( $res->[2]->[0], 'Token value' ); +my $count = $res->[2]->[0] =~ s/$1//g; +ok( $count == 2, 'Two token value found' ) + or explain( $res->[2]->[0], '2 token values found' ); +count(3); $query =~ s/uid=/uid=dwho/; ok(