lib/Reaction/InterfaceModel/Action/User/SetPassword.pm

filter: Statementstmt 65.5% 19 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 57.1% 4 / 7 Podpod 100% 1 / 1 totaltotal 43.6% 24 / 55 CC 6 SCAR 19.9
CC
6
Cov
45%
__ANON__
12.0
verify_confirm_new_password
12.0
__ANON__
6.0
CRAP 7.3
« lib/Reaction/UI/Widget/Value.pm ↑ Summary lib/Reaction/UI/ViewPort/Object.pm »
1 package Reaction::InterfaceModel::Action::User::SetPassword;
2  
3 1 ▶use Reaction::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Reaction::InterfaceModel::Action;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Reaction::Types::Core qw(Password);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use namespace::clean -except => [ qw(meta) ];
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 extends 'Reaction::InterfaceModel::Action';
9  
10  
11  
12 1 has new_password => (isa => Password, is => 'rw', lazy_fail => 1);
13 1 has confirm_new_password =>
14 (isa => Password, is => 'rw', lazy_fail => 1);
15  
16 0 ▶around error_for_attribute => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
17 0 my $super = shift;
18 0 my ($self, $attr) = @_;
19 0 ▶ if ($attr->name eq 'confirm_new_password') {
Branch: 1 branch
BranchTrueFalseTotal
if ($attr->name eq "confirm_new_password") 0 0 0
20 0 ▶ return "New password doesn't match"
Branch: 1 branch
BranchTrueFalseTotal
unless $self->verify_confirm_new_password 0 0 0
21 unless $self->verify_confirm_new_password;
22 }
23 0 return $super->(@_);
24 1 };
25  
26 0 ▶around can_apply => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
27 0 my $super = shift;
28 0 my ($self) = @_;
29 0 ▶ return $super->(@_) && $self->verify_confirm_new_password;;
Condition0%0/3
&$super(@_) && $self->verify_confirm_new_password
!ll&&!rl&&r
000
MC/DC0%0/2
&$super(@_) && $self->verify_confirm_new_password
&$super(@_) $self->verify_confirm_new_password
Truth table0%0/3
A && B
A= &$super(@_)B= $self->verify_confirm_new_password
ABresult
0X0
100
111
30 1 };
31 0 ▶sub verify_confirm_new_password {
Subroutine verify_confirm_new_password: not called CC=3 SCAR=24.8
Pod documented
32 0 my $self = shift;
33 0 ▶ return $self->has_new_password && $self->has_confirm_new_password
Condition0%0/6
$self->has_new_password && $self->has_confirm_new_password && $self->new_password eq $self->confirm_new_password
!ll&&!rl&&r
000
$self->has_new_password and $self->has_confirm_new_password
!ll&&!rl&&r
000
MC/DC0%0/3
$self->has_new_password && $self->has_confirm_new_password && $self->new_password eq $self->confirm_new_password
$self->has_new_password $self->has_confirm_new_password $self->new_password eq $self->confirm_new_password
Truth table0%0/4
A and B && C
A= $self->has_new_passwordB= $self->has_confirm_new_passwordC= $self->new_password eq $self->confirm_new_password
ABCresult
0XX0
10X0
1100
1111
34 && ($self->new_password eq $self->confirm_new_password);
35 };
36  
37 1 __PACKAGE__->meta->make_immutable;
38  
39  
40 1 1;
41  
42 =head1 NAME
43  
44 Reaction::InterfaceModel::Action::User::SetPassword
45  
46 =head1 DESCRIPTION
47  
48 =head1 ATTRIBUTES
49  
50 =head2 new_password
51  
52 =head2 confirm_new_password
53  
54 =head1 METHODS
55  
56 =head2 verify_confirm_new_password
57  
58 Tests to make sure that C<new_password> and C<confirm_new_password> match.
59  
60 =head1 SEE ALSO
61  
62 L<Reaction::InterfaceModel::Action::DBIC::User::SetPassword>
63  
64 =head1 AUTHORS
65  
66 See L<Reaction::Class> for authors.
67  
68 =head1 LICENSE
69  
70 See L<Reaction::Class> for the license.
71  
72 =cut
« lib/Reaction/UI/Widget/Value.pm ↑ Summary lib/Reaction/UI/ViewPort/Object.pm »