TestLdapi
extends LDAPI
in package
Test extension of LDAPI
Relies on local fixtures instead of an actual connection. For this test version, no LDAP server is needed.
The basic connect and get functions are overloaded, such that the LDAPI and the returned objects still behave regularly.
Table of Contents
- $_committees : array<string|int, LDAPUser>
- Storages for fixtured object
- $_forwards : array<string|int, LDAPUser>
- Storages for fixtured object
- $_users : array<string|int, LDAPUser>
- Storages for fixtured object
- __construct() : mixed
- Overloaded constructor
- __destruct() : mixed
- Overloaded destructor
- _getEmailForward() : mixed
- Returned fixtured email forward
- _saveEmailForward() : mixed
- Update fixtured email forward
- _saveNewObject() : mixed
- Save an object by updating the registered fixtures
- _saveUpdatedObject() : mixed
- Update fixtures with modified object
- _writeCheck() : mixed
- Enable write check by default
- classes_equal() : bool
- Extension of is_subclass_of()
- deleteCommittee() : mixed
- Remove a fixtured committee
- deleteUser() : mixed
- {@inheritDoc}}
- _filterObjectByValues() : mixed
- Mocked filter method to suit the fixtures
- _findObjectsByValues() : mixed
- Mocked find-objects base method
- _makeConnection() : mixed
- Overloaded connection function - No actual connection is made
Properties
$_committees
Storages for fixtured object
public
static array<string|int, LDAPUser>
$_committees
= []
These properties should be treated like being static, let only the designated fixtures use them.
$_forwards
Storages for fixtured object
public
static array<string|int, LDAPUser>
$_forwards
= []
These properties should be treated like being static, let only the designated fixtures use them.
$_users
Storages for fixtured object
public
static array<string|int, LDAPUser>
$_users
= []
These properties should be treated like being static, let only the designated fixtures use them.
Methods
__construct()
Overloaded constructor
public
__construct() : mixed
No actual configuration is loaded.
Return values
mixed —__destruct()
Overloaded destructor
public
__destruct() : mixed
Return values
mixed —_getEmailForward()
Returned fixtured email forward
public
_getEmailForward(mixed $user) : mixed
Parameters
- $user : mixed
Return values
mixed —_saveEmailForward()
Update fixtured email forward
public
_saveEmailForward(mixed $user, mixed $email) : mixed
Parameters
- $user : mixed
- $email : mixed
Return values
mixed —_saveNewObject()
Save an object by updating the registered fixtures
public
_saveNewObject(mixed $object[, mixed $additional_fields = null ]) : mixed
Parameters
- $object : mixed
- $additional_fields : mixed = null
Return values
mixed —_saveUpdatedObject()
Update fixtures with modified object
public
_saveUpdatedObject(mixed $object) : mixed
Parameters
- $object : mixed
Return values
mixed —_writeCheck()
Enable write check by default
public
_writeCheck() : mixed
Return values
mixed —classes_equal()
Extension of is_subclass_of()
public
static classes_equal(string $a, string $b) : bool
Checks if $a is a subclass of $b, or equal to $b. Both parameters are meant to be class names, not objects.
Parameters
- $a : string
- $b : string
Return values
bool —deleteCommittee()
Remove a fixtured committee
public
deleteCommittee(mixed $committee) : mixed
Parameters
- $committee : mixed
Return values
mixed —deleteUser()
{@inheritDoc}}
public
deleteUser(mixed $user) : mixed
Parameters
- $user : mixed
Return values
mixed —_filterObjectByValues()
Mocked filter method to suit the fixtures
protected
_filterObjectByValues(mixed $object, mixed $criteria) : mixed
This does not yet perfectly mock the real LDAP filtering!
Parameters
- $object : mixed
- $criteria : mixed
Return values
mixed —_findObjectsByValues()
Mocked find-objects base method
protected
_findObjectsByValues(mixed $class[, mixed $criteria = null ][, mixed $by_id = false ]) : mixed
Parameters
- $class : mixed
- $criteria : mixed = null
- $by_id : mixed = false
Return values
mixed —_makeConnection()
Overloaded connection function - No actual connection is made
protected
_makeConnection() : mixed