@@ -85,6 +85,16 @@ private function ensureUserDoesNotExist()
85
85
}
86
86
}
87
87
88
+ private function ensureOrgGroupDoesNotExist ()
89
+ {
90
+ global $ USER ;
91
+ $ org_group = $ USER ->getOrgGroup ();
92
+ if ($ org_group ->exists ()) {
93
+ $ org_group ->getLDAPOrgGroup ()->delete ();
94
+ assert (!$ org_group ->exists ());
95
+ }
96
+ }
97
+
88
98
private function ensureUserNotInPIGroup (UnityGroup $ pi_group )
89
99
{
90
100
global $ USER ;
@@ -139,6 +149,7 @@ public function testCreateUserByJoinGoup()
139
149
$ this ->assertNumberGroupRequests (0 );
140
150
$ this ->assertTrue ($ pi_group ->userExists ($ USER ));
141
151
$ this ->assertTrue ($ USER ->exists ());
152
+ $ this ->assertTrue ($ USER ->getOrgGroup ()->exists ());
142
153
143
154
// $third_request_failed = false;
144
155
// try {
@@ -152,6 +163,7 @@ public function testCreateUserByJoinGoup()
152
163
} finally {
153
164
$ this ->ensureUserNotInPIGroup ($ pi_group );
154
165
$ this ->ensureUserDoesNotExist ();
166
+ $ this ->ensureOrgGroupDoesNotExist ();
155
167
}
156
168
}
157
169
@@ -162,6 +174,7 @@ public function testCreateUserByCreateGroup()
162
174
$ pi_group = $ USER ->getPIGroup ();
163
175
$ this ->assertTrue (!$ USER ->exists ());
164
176
$ this ->assertTrue (!$ pi_group ->exists ());
177
+ $ this ->assertTrue (!$ USER ->getOrgGroup ()->exists ());
165
178
try {
166
179
$ this ->requestGroupCreation ();
167
180
$ this ->assertNumberGroupRequests (1 );
@@ -185,6 +198,7 @@ public function testCreateUserByCreateGroup()
185
198
$ this ->assertNumberGroupRequests (0 );
186
199
$ this ->assertTrue ($ pi_group ->exists ());
187
200
$ this ->assertTrue ($ USER ->exists ());
201
+ $ this ->assertTrue ($ USER ->getOrgGroup ()->exists ());
188
202
189
203
// $third_request_failed = false;
190
204
// try {
@@ -197,6 +211,7 @@ public function testCreateUserByCreateGroup()
197
211
} finally {
198
212
$ this ->ensurePIGroupDoesNotExist ();
199
213
$ this ->ensureUserDoesNotExist ();
214
+ $ this ->ensureOrgGroupDoesNotExist ();
200
215
}
201
216
}
202
217
}
0 commit comments