Lines 20-26
Link Here
|
20 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
21 |
|
21 |
|
22 |
use Modern::Perl; |
22 |
use Modern::Perl; |
23 |
use Test::More tests => 10; |
23 |
use Test::More tests => 11; |
24 |
use Time::HiRes qw|usleep|; |
24 |
use Time::HiRes qw|usleep|; |
25 |
use C4::Context; |
25 |
use C4::Context; |
26 |
use Koha::Token; |
26 |
use Koha::Token; |
Lines 89-91
subtest 'Same logged in user with another session (cookie CGISESSID)' => sub {
Link Here
|
89 |
}); |
89 |
}); |
90 |
is( $result, '', "CSRF token is not verified if another session is used" ); |
90 |
is( $result, '', "CSRF token is not verified if another session is used" ); |
91 |
}; |
91 |
}; |
92 |
- |
92 |
|
|
|
93 |
subtest 'Pattern parameter' => sub { |
94 |
plan tests => 4; |
95 |
my $id = $tokenizer->generate({ pattern => '\d\d', length => 8 }); |
96 |
is( length($id), 2, 'Pattern overrides length' ); |
97 |
ok( $id =~ /\d{2}/, 'Two digits found' ); |
98 |
$id = $tokenizer->generate({ pattern => '[A-Z]{10}' }); |
99 |
is( length($id), 10, 'Check length again' ); |
100 |
ok( $id !~ /[^A-Z]/, 'Only uppercase letters' ); |
101 |
}; |