/usr/share/php/tests/Horde_Kolab_Server/Horde/Kolab/Server/Integration/GroupHandlingTestTodo.php is in php-horde-kolab-server 2.0.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | <?php
/**
* Handling groups.
*
* PHP version 5
*
* @category Kolab
* @package Kolab_Server
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
/**
* Require our basic test case definition
*/
require_once __DIR__ . '/Scenario.php';
/**
* Handling groups.
*
* Copyright 2008-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Kolab
* @package Kolab_Server
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
class Horde_Kolab_Server_Integration_GroupHandlingTest extends Horde_Kolab_Server_Integration_Scenario
{
/**
* Test listing groups if there are no groups.
*
* @scenario
*
* @return NULL
*/
public function listingGroupsOnEmptyServer()
{
$this->given('several Kolab servers')
->when(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then('the list is an empty array');
}
/**
* Test listing groups after adding some groups.
*
* @param array $group_list The groups to add.
*
* @scenario
* @dataProvider groupLists
*
* @return NULL
*/
public function listingGroups($group_list)
{
$this->given('several Kolab servers')
->when('adding an object list', $group_list)
->and(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then('the result indicates success.')
->and(
'the list has a number of entries equal to',
count($group_list)
);
}
/**
* Test the list of groups for the group id.
*
* @param array $group_list The groups to add.
*
* @scenario
* @dataProvider groupLists
*
* @return NULL
*/
public function listingGroupsHasAttributeId($group_list)
{
$this->given('several Kolab servers')
->when('adding an object list', $group_list)
->and(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then(
'the provided list and the result list match with regard to these attributes',
'mail', 'cn', $group_list
);
}
/**
* Test the list of groups for the group mail address.
*
* @param array $group_list The groups to add.
*
* @scenario
* @dataProvider groupLists
*
* @return NULL
*/
public function listingGroupsHasAttributeMail($group_list)
{
$this->given('several Kolab servers')
->when('adding an object list', $group_list)
->and(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then(
'the provided list and the result list match with regard to these attributes',
'mail', 'mail', $group_list
);
}
/**
* Test the list of groups for the group visibility.
*
* @param array $group_list The groups to add.
*
* @scenario
* @dataProvider groupLists
*
* @return NULL
*/
public function listingGroupsHasAttributeVisibility($group_list)
{
$this->given('several Kolab servers')
->when('adding an object list', $group_list)
->and(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then(
'each element in the result list has an attribute',
'visible'
);
}
/**
* Test adding an invalid group.
*
* @scenario
*
* @return NULL
*/
public function creatingGroupsWithoutMailAddressFails()
{
$this->given('several Kolab servers')
->when('adding a group without a mail address')
->then(
'the result should indicate an error with',
'Adding object failed: The value for "mail" is missing!'
);
}
/**
* Test adding a group without setting the visibility.
*
* @scenario
*
* @return NULL
*/
public function creatingGroupWithoutVisibilityCreatesVisibleGroup()
{
$this->given('several Kolab servers')
->when('adding an object', $this->provideGroupWithoutMembers())
->and(
'retrieving a hash list with all objects of type',
'Horde_Kolab_Server_Object_Kolabgroupofnames'
)
->then(
'each element in the result list has an attribute set to a given value',
'visible', true
);
}
/**
* Test modifying a group mail address.
*
* @scenario
*
* @return NULL
*/
public function modifyingGroupMailAddressIsNotAllowed()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "test@example.org"')
->and('modifying the mail address to "new@example.org"')
->then(
'the result should indicate an error with',
'The group cannot be modified: Changing the mail address from "test@example.org" to "new@example.org" is not allowed!'
);
}
/**
* Test modifying a group mail address.
*
* @scenario
*
* @return NULL
*/
public function conflictBetweenGroupMailAndUserMailIsNotAllowed()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "test@example.org"')
->and('adding a user "Test Test" with the mail address "test@example.org"')
->then(
'the result should indicate an error with',
'The user cannot be added: Mail address "test@example.org" is already the mail address for the group "test@example.org"!'
);
}
/**
*
* @scenario
*
* @return NULL
*/
public function conflictBetweenUserMailAndGroupMailIsNotAllowed()
{
$this->given('several Kolab servers')
->when('adding a user "Test Test" with the mail address "test@example.org"')
->and('adding a group with the mail address "test@example.org"')
->then(
'the result should indicate an error with',
'The group cannot be added: Mail address "test@example.org" is already the mail address of the user "Test Test"!'
);
}
/**
* @scenario
*/
public function conflictBetweenGroupMailAndUserAliasIsNotAllowed()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "test@example.org"')
->and('adding a user with the alias address "test@example.org"')
->then(
'the result should indicate an error with',
'The user cannot be added: Alias address "test@example.org" is already the mail address of the group "test@example.org"!'
);
}
/**
* @scenario
*/
public function conflictBetweenUserAliasAndGroupMailIsNotAllowed()
{
$this->given('several Kolab servers')
->when('adding a user "Test Test" with the alias address "test@example.org"')
->and('adding a group with the mail address "test@example.org"')
->then(
'the result should indicate an error with',
'The group cannot be added: Mail address "test@example.org" is already the alias address of the user "Test Test"!'
);
}
/**
* kolab/issue890 (Assigning multiple Distribution Lists to user during creation and modification)
*
* @scenario
*/
public function showGroupsWhenFetchingTheUser()
{
$this->given('several Kolab servers')
->when('adding a user "cn=Test Test" with the mail address "test@example.org"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('fetching the user "test@example.org"')
->and('listing the groups of this user')
->then('the list should contain "testgroup@example.org"');
}
/**
* @scenario
*/
public function allowAddingUserToGroup()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "testgroup@example.org"')
->and('adding a user "cn=Test Test" with the mail address "test@example.org"')
->and('modifying group with the mail address "testgroup@example.org" to contain the member "cn=Test Test".')
->and('fetching the groups "group@example.org"')
->and('listing the members of this group')
->then('the list should contain "test@example.org"');
}
/**
* @scenario
*/
public function allowAddingUserToGroupWhenCreatingUser()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "testgroup@example.org"')
->and('adding a user "cn=Test Test" with the mail address "test@example.org" and member of "testgroup@example.org"')
->and('fetching the groups "group@example.org"')
->and('listing the members of this group')
->then('the list should contain "test@example.org"');
}
/**
* @scenario
*/
public function allowRemovingUserFromGroup()
{
$this->given('several Kolab servers')
->when('adding a user "cn=Test Test" with the mail address "test@example.org"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('modifying group with the mail address "testgroup@example.org" to contain no members.')
->and('fetching the groups "group@example.org"')
->and('listing the members of this group')
->then('the list is empty');
}
/**
* @scenario
*/
public function deletingUserRemovesUserFromAllDistributionLists()
{
$this->given('several Kolab servers')
->when('adding a user "cn=Test Test" with the mail address "test@example.org"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('adding a group with the mail address "testgroup2@example.org" and the member "cn=Test Test"')
->and('deleting user "cn=Test Test"')
->and('listing the members of group "testgroup@example.org"')
->and('listing the members of group "testgroup2@example.org"')
->then('the list of group "testgroup@example.org" is empty')
->and('the list of group "testgroup2@example.org" is empty');
}
/**
* @scenario
*/
public function modifyingUserIDDoesNotChangeGroupMembership()
{
$this->given('several Kolab servers')
->when('adding a user "cn=Test Test" with the mail address "test@example.org"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('modifying user "cn=Test Test" to ID "cn=Test2 Test"')
->and('listing the members of group "testgroup@example.org"')
->then('the list of group "testgroup@example.org" contains "cn=Test2 Test"');
}
/**
* @scenario
*/
public function addingGroupInUndefinedDomainIsNotAllowed()
{
$this->given('several Kolab servers')
->and('the only served mail domain is "example.org"')
->when('adding a group with the mail address "test@doesnotexist.org"')
->then(
'the result should indicate an error with',
'The group cannot be added: Domain "doesnotexist.org" is not being handled by this server!'
);
}
/**
* kolab/issue1368 (Webinterface allows to create email addresses with slash that cyrus cannot handle)
*
* @scenario
* @dataProvider invalidMails
*/
public function disallowInvalidMailAddresses($address)
{
$this->given('several Kolab servers')
->when('adding a group with an invalid mail address', $address)
->then(
'the result should indicate an error with',
"The group cannot be added: Address \"$address\" is not a valid mail address!"
);
}
/**
* @scenario
*/
public function objectAttributeDescriptionsCanBeRetrieved()
{
$this->given('several Kolab servers')
->when('retrieving the supported attributes by the object type "group"')
->then('the result is an array of Horde attribute descriptions')
->and('contains the description of "members"');
}
/**
* @scenario
*/
public function removingGroupFailsIfGroupDoesNotExist()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "group@example.org"')
->and('deleting the group with the mail address "group@example.org"')
->then(
'the result should indicate an error with',
'The group cannot be deleted: Group "group@example.org" does not exist!'
);
}
/**
* @scenario
*/
public function removingGroupByMailSucceeds()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "test@example.org"')
->and('deleting the group with mail address "test@example.org"')
->then('the result indicates success')
->and('listing all groups returns an empty list');
}
/**
* kolab/issue1189 (IMAP login fails on some specific uids)
*
* @scenario
*/
public function userUidsShouldNotResembleTheLocalPartOfMailAddresses()
{
$this->given('several Kolab servers')
->when('adding a group with the mail address "test@example.org"')
->and('adding a user with the uid "test"')
->then(
'the result should indicate an error with',
'The user cannot be added: The uid "test" matches the local part of the mail address "test@example.org" assigned to group "test@example.org"!'
);
}
/**
* kolab/issue2207 (Make it possible to enable and disable users to be able to use the webclient.)
*
* @scenario
*/
public function addedUserCanLoginIfInAllowedGroup()
{
$this->given('several Kolab servers')
->and('Horde uses the Kolab auth driver')
->and('only members of group "testgroup@example.org" are allowed')
->when('adding a user "cn=Test Test" with the mail address "test@example.org" and password "test"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('trying to login to Horde with "test@example.org" and passowrd "test"')
->then('the result indicates success')
->and('the session shows "test@example.org" as the current user');
}
/**
* kolab/issue2207 (Make it possible to enable and disable users to be able to use the webclient.)
*
* @scenario
*/
public function addedUserCannotLoginIfInNotInAllowedGroup()
{
$this->given('several Kolab servers')
->and('Horde uses the Kolab auth driver')
->and('only members of group "testgroup@example.org" are allowed')
->when('adding a user "cn=Test Test" with the mail address "test@example.org" and password "test"')
->and('adding a group with the mail address "testgroup@example.org" and no members')
->and('trying to login to Horde with "test@example.org" and passowrd "test"')
->then('the user may not login');
}
/**
* kolab/issue2207 (Make it possible to enable and disable users to be able to use the webclient.)
*
* @scenario
*/
public function addedUserCanLoginIfInNotInDisallowedGroup()
{
$this->given('several Kolab servers')
->and('Horde uses the Kolab auth driver')
->and('members of group "testgroup@example.org" may not login')
->when('adding a user "cn=Test Test" with the mail address "test@example.org" and password "test"')
->and('adding a group with the mail address "testgroup@example.org" and no members')
->and('trying to login to Horde with "test@example.org" and passowrd "test"')
->then('the result indicates success')
->and('the session shows "test@example.org" as the current user');
}
/**
* kolab/issue2207 (Make it possible to enable and disable users to be able to use the webclient.)
*
* @scenario
*/
public function addedUserCannotLoginIfInDisallowedGroup()
{
$this->given('several Kolab servers')
->and('Horde uses the Kolab auth driver')
->and('members of group "testgroup@example.org" may not login')
->when('adding a user "cn=Test Test" with the mail address "test@example.org" and password "test"')
->and('adding a group with the mail address "testgroup@example.org" and the member "cn=Test Test"')
->and('trying to login to Horde with "test@example.org" and passowrd "test"')
->then('the user may not login');
}
}
|