Skeletal start of a User object
authorChris Cormack <chrisc@catalyst.net.nz>
Wed, 28 Aug 2013 22:48:30 +0000 (10:48 +1200)
committerJason Stephenson <jstephenson@mvlc.org>
Thu, 29 Aug 2013 20:17:26 +0000 (16:17 -0400)
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

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
lib/NCIP/User.pm [new file with mode: 0644]
t/NCIP_User.t [new file with mode: 0644]

diff --git a/lib/NCIP/User.pm b/lib/NCIP/User.pm
new file mode 100644 (file)
index 0000000..46e2d96
--- /dev/null
@@ -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 (file)
index 0000000..659af94
--- /dev/null
@@ -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");
+