add a new test to check getting a user with an undefined Id
This commit is contained in:
parent
ad85d802fe
commit
8d7c31253b
1 changed files with 6 additions and 1 deletions
7
t/User.t
7
t/User.t
|
|
@ -20,7 +20,7 @@ use WebGUI::Cache;
|
|||
use WebGUI::User;
|
||||
use WebGUI::ProfileField;
|
||||
|
||||
use Test::More tests => 101; # increment this value for each test you create
|
||||
use Test::More tests => 102; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
|
@ -177,6 +177,11 @@ $user = WebGUI::User->new($session);
|
|||
is($user->userId, '1', 'new() -- returns visitor with no args');
|
||||
$user = "";
|
||||
|
||||
#Let's test new to retrieve a non-existing user
|
||||
$user = WebGUI::User->new($session, 'xxYYxxYYxxYYxxYYxxYYxx');
|
||||
isa_ok($user, 'WebGUI::User', 'non-existant ID returns valid user object');
|
||||
$user = "";
|
||||
|
||||
$user = WebGUI::User->new($session, "new", "ROYSUNIQUEUSERID000002");
|
||||
is($user->userId, "ROYSUNIQUEUSERID000002", 'new() -- override user id');
|
||||
$user->authMethod("LDAP");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue