Silki/AppRole/User.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 38 CC 2 SCAR 11.5
CC
2
Cov
0%
_build_user
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.1
1 package Silki::AppRole::User;
2 {
3 $Silki::AppRole::User::VERSION = '0.29';
4 }
5  
6 use strict;
7 use warnings;
8 use namespace::autoclean;
9  
10 use Silki::Schema::User;
11  
12 use Moose::Role;
13  
14 has 'user' => (
15 is => 'ro',
16 isa => 'Silki::Schema::User',
17 lazy => 1,
18 builder => '_build_user',
19 );
20  
21 sub _build_user {
22 my $self = shift;
23  
24 my $cookie = $self->authen_cookie_value();
25  
26 my $user;
27 $user = Silki::Schema::User->new( user_id => $cookie->{user_id} )
28 if $cookie->{user_id};
29  
30 return $user ||= Silki::Schema::User->GuestUser();
31 }
32  
33 1;
34  
35 # ABSTRACT: Adds $c->user() to the Catalyst object
36  
37 __END__