diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-05-29 19:23:09 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-05-29 19:23:09 +0200 |
commit | 38212d4ef22cc0ed017c4c259e6434dab36cb852 (patch) | |
tree | ab0a277a91e8e59ceea5787354fc0d49c945fd49 /t | |
parent | 1a663c782f6dbd7027954a2fd2c39e8bcf0e182f (diff) | |
download | manatools-38212d4ef22cc0ed017c4c259e6434dab36cb852.tar manatools-38212d4ef22cc0ed017c4c259e6434dab36cb852.tar.gz manatools-38212d4ef22cc0ed017c4c259e6434dab36cb852.tar.bz2 manatools-38212d4ef22cc0ed017c4c259e6434dab36cb852.tar.xz manatools-38212d4ef22cc0ed017c4c259e6434dab36cb852.zip |
now AdminPanel::Shared::Users is under Moose
Diffstat (limited to 't')
-rw-r--r-- | t/02-Users.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/02-Users.t b/t/02-Users.t new file mode 100644 index 00000000..48373194 --- /dev/null +++ b/t/02-Users.t @@ -0,0 +1,36 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +BEGIN { + use_ok( 'AdminPanel::Shared::Users' ) || print "Users failed!\n"; +} + + ok( my $o = AdminPanel::Shared::Users->new({user_face_dir => '/tmp'}), 'create'); + ok( my $facedir = $o->facedir(), 'facedir' ); + diag "facedir got: < " . $facedir . " >"; + ok( my $userfacedir = $o->userfacedir(), 'userfacedir' ); + diag "userfacedir got: < " . $userfacedir . " >"; + ok( my $ipathname = $o->face2png('username'), 'face2png' ); + diag "face2png for user \'username\' got: < " . $ipathname . " >"; + ok( my $facenames = $o->facenames(), 'facenames' ); + diag "facenames got: < " . scalar(@$facenames) . " elements >"; + ok( $o->addKdmIcon('username', $facenames->[0]), 'addKdmIcon' ); + + ok( my ($val, $str) = $o->valid_username('username'), 'valid_username' ); + diag "valid_username(username) got: < " . $str . " >"; + ok(($val, $str) = $o->valid_username('3D-user'), 'not_valid_username'); + diag "valid_username(3D-user) got: < " . $str . " >"; + ok( ($val, $str) = $o->valid_groupname('groupname'), 'valid_groupname' ); + diag "valid_groupname(groupname) got: < " . $str . " >"; + ok(($val, $str) = $o->valid_groupname('g1234567890123456'), 'not_valid_groupname'); + diag "valid_groupname(g1234567890123456) got: < " . $str . " >"; + ok( my $face = $o->GetFaceIcon('username', 1), 'GetFaceIcon' ); + diag "GetFaceIcon after '" . $facenames->[0] . "' got: < ". $face ." >"; + ok( $o->strongPassword('S0meWh3r3'), 'strongPassword' ); + + ok( $o->removeKdmIcon('username'), 'removeKdmIcon' ); + +done_testing; |