From b37dbb7e29b5b0b443b5d1c23dcfbdbcfac1f4d3 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 29 Aug 2013 10:48:30 +1200 Subject: [PATCH] Skeletal start of a User object perl t/NCIP_User.t 1..4 ok 1 - use NCIP::User; ok 2 - Create a new user object ok 3 - Set firstname ok 4 - Test our getting --- lib/NCIP/User.pm | 30 ++++++++++++++++++++++++++++++ t/NCIP_User.t | 14 ++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lib/NCIP/User.pm create mode 100644 t/NCIP_User.t diff --git a/lib/NCIP/User.pm b/lib/NCIP/User.pm new file mode 100644 index 0000000..46e2d96 --- /dev/null +++ b/lib/NCIP/User.pm @@ -0,0 +1,30 @@ +package NCIP::User; + +use base qw(Class::Accessor); + +# User Object needs +# Authentication Input +# Block Or Trap +# Date Of Birth +# Name Information +# Previous User Id(s) +# User Address Information +# User Language +# User Privilege +# User Id + +# Make accessors for the ones that makes sense +NCIP::User->mk_accessors(qw(firstname surname address language privilege userid dateofbirth)); + +sub authentication { +} + +sub previous_userids { +} + +sub status { + # Is the user blocked + # if so, why +} + +1; diff --git a/t/NCIP_User.t b/t/NCIP_User.t new file mode 100644 index 0000000..659af94 --- /dev/null +++ b/t/NCIP_User.t @@ -0,0 +1,14 @@ +#/usr/bin/perl + +use strict; +use warnings; +use lib 'lib'; + +use Test::More tests => 4; # last test to print + +use_ok('NCIP::User'); + +ok(my $user = NCIP::User->new(),'Create a new user object'); +ok($user->firstname('Chris'),'Set firstname'); +is($user->firstname(), 'Chris', "Test our getting"); + -- 2.43.2