Helper/Users/VerificationCodes.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 19 CC 1 SCAR 6.9
CC
1
Cov
0%
verification
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Daje::Helper::Users::VerificationCodes;
2 use Mojo::Base -base;
3 use v5.42;
4  
5 # NAME
6 # ====
7 #
8 # Daje::Helper::Users::VerificationCodes - It's the login verification code manager
9 #
10 #
11 # REQUIRES
12 # ========
13 #
14 # use Mojo::Base;
15 # use Daje::Database::Model::Super::Users;
16 #
17 # DESCRIPTION
18 # ===========
19 #
20 # Daje::Helper::Users::VerificationCodes is verifying logging in users
21 #
22 # LICENSE
23 # =======
24 #
25 # Copyright (C) janeskil1525.
26 #
27 # This library is free software; you can redistribute it and/or modify
28 # it under the same terms as Perl itself.
29 #
30 # AUTHOR
31 # ======
32 #
33 # janeskil1525 E<lt>janeskil1525@gmail.comE<gt>
34 #
35 #
36  
37 use Daje::Database::Model::UsersVerificationCodes;
38  
39 has 'db';
40  
41 sub verification($self, $users_users_pkey) {
42  
43 my @set = ('0' ..'9', 'A' .. 'F');
44 my $verification_code = join '' => map $set[rand @set], 1 .. 4;
45  
46 my $login_verification_codes_pkey = Daje::Database::Model::UsersVerificationCodes->new(
47 db => $self->db
48 )->save_verification_code(
49 $users_users_pkey, $verification_code
50 );
51  
52 return $verification_code;
53 }
54 1;