[Rt-commit] r4184 - in rt/branches/CHALDEA-EXPERIMENTAL: . lib/RT
jesse at bestpractical.com
jesse at bestpractical.com
Wed Nov 30 16:28:04 EST 2005
Author: jesse
Date: Wed Nov 30 16:28:03 2005
New Revision: 4184
Modified:
rt/branches/CHALDEA-EXPERIMENTAL/ (props changed)
rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Groups_Overlay.pm
Log:
r19601 at truegrounds: jesse | 2005-11-30 16:07:00 -0500
r19558 at truegrounds: jesse | 2005-11-30 15:28:23 -0500
r18716 at truegrounds: jesse | 2005-11-11 00:10:08 -0500
* fix from ruslan for fallout from his WhoHaveRight refactoring
Modified: rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Groups_Overlay.pm
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Groups_Overlay.pm (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Groups_Overlay.pm Wed Nov 30 16:28:03 2005
@@ -87,6 +87,24 @@
# {{{ sub _Init
+=begin testing
+
+# next had bugs
+# Groups->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => xx );
+my $g = RT::Group->new($RT::SystemUser);
+my ($id, $msg) = $g->CreateUserDefinedGroup(Name => 'GroupsNotEqualTest');
+ok ($id, "created group #". $g->id) or diag("error: $msg");
+
+my $groups = RT::Groups->new($RT::SystemUser);
+$groups->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $g->id );
+$groups->LimitToUserDefinedGroups();
+my $bug = grep $_->id == $g->id, @{$groups->ItemsArrayRef};
+ok (!$bug, "didn't find group");
+
+=end testing
+
+=cut
+
sub _Init {
my $self = shift;
$self->{'table'} = "Groups";
@@ -98,13 +116,13 @@
FIELD => 'Name',
ORDER => 'ASC');
- $self->{'princalias'} = $self->NewAlias('Principals');
-
# XXX: this code should be generalized
- $self->Join( ALIAS1 => 'main',
- FIELD1 => 'id',
- ALIAS2 => $self->{'princalias'},
- FIELD2 => 'id' );
+ $self->{'princalias'} = $self->Join(
+ ALIAS1 => 'main',
+ FIELD1 => 'id',
+ TABLE2 => 'Principals',
+ FIELD2 => 'id'
+ );
# even if this condition is useless and ids in the Groups table
# only match principals with type 'Group' this could speed up
@@ -253,7 +271,7 @@
$u->Create(Name => 'Membertests');
my $g = RT::Group->new($RT::SystemUser);
my ($id, $msg) = $g->CreateUserDefinedGroup(Name => 'Membertests');
-ok ($id,$msg);
+ok ($id, $msg);
my ($aid, $amsg) =$g->AddMember($u->id);
ok ($aid, $amsg);
@@ -265,9 +283,6 @@
ok ($groups->Count == 1,"found the 1 group - " . $groups->Count);
ok ($groups->First->Id == $g->Id, "it's the right one");
-
-
-
=end testing
More information about the Rt-commit
mailing list