Add expectPdata function to test lib

increase-RDBI-perf
Maxime Besson 4 years ago
parent fad337c58c
commit 3b76479bda
  1. 17
      lemonldap-ng-portal/t/test-lib.pm

@ -455,6 +455,23 @@ sub expectCookie {
return $id;
}
=head4 expectPdata( $res );
Check if the pdata cookie exists and returns its deserialized value.
=cut
sub expectPdata {
my ($res) = @_;
my $val = expectCookie( $res, "lemonldappdata" );
ok( $val, "Pdata is not empty" );
count(1);
my $pdata;
eval { $pdata = JSON::from_json( uri_unescape($val) ); };
diag($@) if $@;
return $pdata;
}
=head4 exceptCspFormOK( $res, $host )
Verify that C<Content-Security-Policy> header allows one to connect to $host.

Loading…
Cancel
Save