/[A3C]/t/00-model-Person.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/00-model-Person.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

t/00-model-User.t revision 42 by dpavlin, Sun Mar 30 16:58:21 2008 UTC t/00-model-Person.t revision 66 by dpavlin, Wed Apr 9 23:14:47 2008 UTC
# Line 4  use strict; Line 4  use strict;
4    
5  =head1 DESCRIPTION  =head1 DESCRIPTION
6    
7  A basic test harness for the User model.  A basic test harness for the Person model.
8    
9  =cut  =cut
10    
11  use Jifty::Test tests => 11;  use Jifty::Test tests => 11;
12    
13  # Make sure we can load the model  # Make sure we can load the model
14  use_ok('A3C::Model::User');  use_ok('A3C::Model::Person');
15    
16  # Grab a system user  # Grab a system user
17  my $system_user = A3C::CurrentUser->superuser;  my $system_user = A3C::CurrentUser->superuser;
# Line 31  ok($id, "Organization create returned su Line 31  ok($id, "Organization create returned su
31  =cut  =cut
32    
33  # Try testing a create  # Try testing a create
34  my $o = A3C::Model::User->new(current_user => $system_user);  my $o = A3C::Model::Person->new(current_user => $system_user);
35  ($id) = $o->create(  ($id) = $o->create(
36          uid => 42,          uid => 42,
37          hrEduPersonUniqueID => 42,          hrEduPersonUniqueID => 42,
# Line 44  my $o = A3C::Model::User->new(current_us Line 44  my $o = A3C::Model::User->new(current_us
44          hrEduPersonHomeOrg => 'skole.hr',          hrEduPersonHomeOrg => 'skole.hr',
45  #       organization => $organization,  #       organization => $organization,
46  );  );
47  ok($id, "User create returned success");  ok($id, "Person create returned success");
48  ok($o->id, "New User has valid id set");  ok($o->id, "New Person has valid id set");
49  is($o->id, $id, "Create returned the right id");  is($o->id, $id, "Create returned the right id");
50    
51  # And another  # And another
# Line 61  $o->create( Line 61  $o->create(
61          hrEduPersonHomeOrg => 'skole.hr',          hrEduPersonHomeOrg => 'skole.hr',
62  #       organization => $organization,  #       organization => $organization,
63  );  );
64  ok($o->id, "User create returned another value");  ok($o->id, "Person create returned another value");
65  isnt($o->id, $id, "And it is different from the previous one");  isnt($o->id, $id, "And it is different from the previous one");
66    
67  # Searches in general  # Searches in general
68  my $collection =  A3C::Model::UserCollection->new(current_user => $system_user);  my $collection =  A3C::Model::PersonCollection->new(current_user => $system_user);
69  $collection->unlimit;  $collection->unlimit;
70  is($collection->count, 2, "Finds two records");  is($collection->count, 2, "Finds two records");
71    

Legend:
Removed from v.42  
changed lines
  Added in v.66

  ViewVC Help
Powered by ViewVC 1.1.26