PHP Class Horde_Kolab_Server_Integration_Scenario, horde

Copyright 2008-2016 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.
Inheritance: extends PHPUnit_Extensions_Story_TestCase
显示文件 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$added array Uid of added objects. Should be removed on tearDown.

Protected Properties

Property Type Description
$_environments array The environments we provide to the test.

Public Methods

Method Description
addBasicUsersToServer ( Horde_Kolab_Server $server ) : null Fill a Kolab Server with test users.
addToServer ( Horde_Kolab_Server $server, array $object ) : Horde_Kolab_Server_Object Add an object to a server and remember it for the tear down method.
addToServers ( array $object ) : array Add an object to the registered servers.
assertEasyAttributes ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $list ) : null Test easy attributes.
assertError ( mixed $var, string $msg = null ) : NULL. Ensure that the variable contains a Horde_Kolab_Server_Exception and fail if it does not. Optionally compare the error message with the provided message and fail if both do not match.
assertNoError ( mixed $var ) : NULL. Ensure that the variable contains no Horde_Kolab_Server_Exception and fail if it does.
assertRecursiveType ( $results, $type )
assertSimpleAttributes ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $list ) : null Test simple attributes.
getEnvironments ( ) : array Identify the environments we want to run our tests in.
getKolabMockServer ( ) : Horde_Kolab_Server Shortcut to get a Kolab mock server.
getKolabServer ( string $environment ) : Horde_Kolab_Server Get a server from a specific environment.
getKolabServers ( ) : array Retrieves the available servers. This assumes all environments have been initialied.
groupLists ( ) : array Provide a set of valid groups.
initializeEnvironment ( string $environment ) : null Initialize the given environment.
initializeEnvironments ( ) : null Initialize the environments.
invalidMails ( )
largeList ( )
listObjectsOnServer ( array $type ) : array List objects on the registered servers.
prepareInjector ( string $environment ) : null Prepare an injector for the given environment.
prepareKolabServer ( string $environment ) : null Prepare the server for the given environment.
prepareKolabServerConfiguration ( string $environment ) : null Prepare the server configuration for the given environment.
prepareLogger ( string $environment ) : null Prepare the log handler for the given environment.
provideBasicAddress ( ) : array Return a test address.
provideBasicAdmin ( ) : array Return a test administrator.
provideBasicDomainMaintainer ( ) : array Return a test domain maintainer.
provideBasicGroupOne ( ) : array Return a test group.
provideBasicGroupTwo ( ) : array Return a test group.
provideBasicMaintainer ( ) : array Return a test maintainer.
provideBasicSharedFolder ( ) : array Return a test shared folder.
provideBasicUserOne ( ) : array Return a test user.
provideBasicUserTwo ( ) : array Return a test user.
provideDistributionList ( )
provideGroupWithoutMembers ( ) : array Return a test group.
provideInvalidUserWithoutGivenName ( )
provideInvalidUserWithoutLastName ( )
provideInvalidUserWithoutMail ( )
provideInvalidUserWithoutPassword ( )
provideInvalidUsers ( )
runGiven ( &$world, string $action, array $arguments ) : mixed Handle a "given" step.
runThen ( &$world, string $action, array $arguments ) : mixed Handle a "then" step.
runWhen ( &$world, string $action, array $arguments ) : mixed Handle a "when" step.
setEnvironments ( array $environments ) : null Specifically set the environments we wish to support.
userAdd ( )
userListByAttribute ( )
userListByLetter ( )
userLists ( )
validAddresses ( )
validAdmins ( )
validDomainMaintainers ( )
validGroups ( ) : array Provide a set of valid groups.
validMaintainers ( )
validSharedFolders ( )
validUsers ( )

Protected Methods

Method Description
assertAdd ( Horde_Kolab_Server $server, array $store, array $fetch ) : NULL. Assert that creating a new object operation yields some predictable attribute results.
assertSimpleSequence ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, string $attribute, array $sequence, $pop_arrays = false ) : NULL. Assert that a save() operation yields some predictable attribute results.
assertStoreFetch ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $store, array $fetch, $pop_arrays = false ) : NULL. Assert that a save() operation yields some predictable attribute results.
fetchByCn ( $server, $cn )
setUp ( ) : NULL. Setup function.
tearDown ( ) : NULL. Cleanup function.

Method Details

addBasicUsersToServer() public method

Fill a Kolab Server with test users.
public addBasicUsersToServer ( Horde_Kolab_Server $server ) : null
$server Horde_Kolab_Server The server to fill.
return null

addToServer() public method

Add an object to a server and remember it for the tear down method.
public addToServer ( Horde_Kolab_Server $server, array $object ) : Horde_Kolab_Server_Object
$server Horde_Kolab_Server The server to add the object to.
$object array The object data to store.
return Horde_Kolab_Server_Object The resulting object.

addToServers() public method

Add an object to the registered servers.
public addToServers ( array $object ) : array
$object array The object data to store.
return array An array of objects.

assertAdd() protected method

Assert that creating a new object operation yields some predictable attribute results.
protected assertAdd ( Horde_Kolab_Server $server, array $store, array $fetch ) : NULL.
$server Horde_Kolab_Server The server the object resides on.
$store array The information to save.
$fetch array The expected results.
return NULL.

assertEasyAttributes() public method

Test easy attributes.
public assertEasyAttributes ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $list ) : null
$object Horde_Kolab_Server_Object
$server Horde_Kolab_Server
$list array
return null

assertError() public method

Ensure that the variable contains a Horde_Kolab_Server_Exception and fail if it does not. Optionally compare the error message with the provided message and fail if both do not match.
public assertError ( mixed $var, string $msg = null ) : NULL.
$var mixed The variable to check.
$msg string The expected error message.
return NULL.

assertNoError() public method

Ensure that the variable contains no Horde_Kolab_Server_Exception and fail if it does.
public assertNoError ( mixed $var ) : NULL.
$var mixed The variable to check.
return NULL.

assertRecursiveType() public method

public assertRecursiveType ( $results, $type )

assertSimpleAttributes() public method

Test simple attributes.
public assertSimpleAttributes ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $list ) : null
$object Horde_Kolab_Server_Object
$server Horde_Kolab_Server
$list array
return null

assertSimpleSequence() protected method

Assert that a save() operation yields some predictable attribute results.
protected assertSimpleSequence ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, string $attribute, array $sequence, $pop_arrays = false ) : NULL.
$object Horde_Kolab_Server_Object The object to work on.
$server Horde_Kolab_Server The server the object resides on.
$attribute string The attribute to work on.
$sequence array The sequence of values to set and expect.
return NULL.

assertStoreFetch() protected method

Assert that a save() operation yields some predictable attribute results.
protected assertStoreFetch ( Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $store, array $fetch, $pop_arrays = false ) : NULL.
$object Horde_Kolab_Server_Object The object to work on.
$server Horde_Kolab_Server The server the object resides on.
$store array The information to save.
$fetch array The expected results.
return NULL.

fetchByCn() protected method

protected fetchByCn ( $server, $cn )

getEnvironments() public method

Identify the environments we want to run our tests in.
public getEnvironments ( ) : array
return array The selected environments.

getKolabMockServer() public method

Shortcut to get a Kolab mock server.
public getKolabMockServer ( ) : Horde_Kolab_Server
return Horde_Kolab_Server The server.

getKolabServer() public method

Get a server from a specific environment.
public getKolabServer ( string $environment ) : Horde_Kolab_Server
$environment string The name of the environment.
return Horde_Kolab_Server The server.

getKolabServers() public method

Retrieves the available servers. This assumes all environments have been initialied.
public getKolabServers ( ) : array
return array The list of test servers.

groupLists() public method

Provide a set of valid groups.
public groupLists ( ) : array
return array The array of groups.

initializeEnvironment() public method

Initialize the given environment.
public initializeEnvironment ( string $environment ) : null
$environment string The name of the environment.
return null

initializeEnvironments() public method

Initialize the environments.
public initializeEnvironments ( ) : null
return null

invalidMails() public method

public invalidMails ( )

largeList() public method

public largeList ( )

listObjectsOnServer() public method

List objects on the registered servers.
public listObjectsOnServer ( array $type ) : array
$type array The type of objects to list.
return array An array of objects.

prepareInjector() public method

Prepare an injector for the given environment.
public prepareInjector ( string $environment ) : null
$environment string The name of the environment.
return null

prepareKolabServer() public method

Prepare the server for the given environment.
public prepareKolabServer ( string $environment ) : null
$environment string The name of the environment.
return null

prepareKolabServerConfiguration() public method

Prepare the server configuration for the given environment.
public prepareKolabServerConfiguration ( string $environment ) : null
$environment string The name of the environment.
return null

prepareLogger() public method

Prepare the log handler for the given environment.
public prepareLogger ( string $environment ) : null
$environment string The name of the environment.
return null

provideBasicAddress() public method

Return a test address.
public provideBasicAddress ( ) : array
return array The test address.

provideBasicAdmin() public method

Return a test administrator.
public provideBasicAdmin ( ) : array
return array The test administrator.

provideBasicDomainMaintainer() public method

Return a test domain maintainer.
public provideBasicDomainMaintainer ( ) : array
return array The test domain maintainer.

provideBasicGroupOne() public method

Return a test group.
public provideBasicGroupOne ( ) : array
return array The test group.

provideBasicGroupTwo() public method

Return a test group.
public provideBasicGroupTwo ( ) : array
return array The test group.

provideBasicMaintainer() public method

Return a test maintainer.
public provideBasicMaintainer ( ) : array
return array The test maintainer.

provideBasicSharedFolder() public method

Return a test shared folder.
public provideBasicSharedFolder ( ) : array
return array The test shared folder.

provideBasicUserOne() public method

Return a test user.
public provideBasicUserOne ( ) : array
return array The test user.

provideBasicUserTwo() public method

Return a test user.
public provideBasicUserTwo ( ) : array
return array The test user.

provideDistributionList() public method

provideGroupWithoutMembers() public method

Return a test group.
public provideGroupWithoutMembers ( ) : array
return array The test group.

provideInvalidUserWithoutGivenName() public method

provideInvalidUserWithoutLastName() public method

provideInvalidUserWithoutMail() public method

provideInvalidUserWithoutPassword() public method

provideInvalidUsers() public method

public provideInvalidUsers ( )

runGiven() public method

Handle a "given" step.
public runGiven ( &$world, string $action, array $arguments ) : mixed
$action string The description of the step.
$arguments array Additional arguments to the step.
return mixed The outcome of the step.

runThen() public method

Handle a "then" step.
public runThen ( &$world, string $action, array $arguments ) : mixed
$action string The description of the step.
$arguments array Additional arguments to the step.
return mixed The outcome of the step.

runWhen() public method

Handle a "when" step.
public runWhen ( &$world, string $action, array $arguments ) : mixed
$action string The description of the step.
$arguments array Additional arguments to the step.
return mixed The outcome of the step.

setEnvironments() public method

Specifically set the environments we wish to support.
public setEnvironments ( array $environments ) : null
$environments array The selected environments.
return null

setUp() protected method

Setup function.
protected setUp ( ) : NULL.
return NULL.

tearDown() protected method

Cleanup function.
protected tearDown ( ) : NULL.
return NULL.

userAdd() public method

public userAdd ( )

userListByAttribute() public method

public userListByAttribute ( )

userListByLetter() public method

public userListByLetter ( )

userLists() public method

public userLists ( )

validAddresses() public method

public validAddresses ( )

validAdmins() public method

public validAdmins ( )

validDomainMaintainers() public method

validGroups() public method

Provide a set of valid groups.
public validGroups ( ) : array
return array The array of groups.

validMaintainers() public method

public validMaintainers ( )

validSharedFolders() public method

public validSharedFolders ( )

validUsers() public method

public validUsers ( )

Property Details

$_environments protected_oe property

The environments we provide to the test.
protected array $_environments
return array

$added public_oe property

Uid of added objects. Should be removed on tearDown.
public array $added
return array