class SimplesamlphpAuthTestManager in simpleSAMLphp Authentication 8.3
Mock SimplesamlphpAuthManager class for testing purposes.
Hierarchy
- class \Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager uses StringTranslationTrait
- class \Drupal\simplesamlphp_auth_test\SimplesamlphpAuthTestManager
Expanded class hierarchy of SimplesamlphpAuthTestManager
File
- tests/
simplesamlphp_auth_test/ src/ SimplesamlphpAuthTestManager.php, line 10
Namespace
Drupal\simplesamlphp_auth_testView source
class SimplesamlphpAuthTestManager extends SimplesamlphpAuthManager {
/**
* Keeps track of whether the user is authenticated.
*
* @var bool
*/
protected $authenticated = FALSE;
/**
* {@inheritdoc}
*/
public function externalAuthenticate() {
$this->authenticated = TRUE;
}
/**
* {@inheritdoc}
*/
public function getStorage() {
return 'sql';
}
/**
* {@inheritdoc}
*/
public function isAuthenticated() {
return $this->authenticated;
}
/**
* {@inheritdoc}
*/
public function getAttributes() {
return [
'uid' => [
0 => 'saml_user',
],
'displayName' => [
0 => 'Test Saml User',
],
'mail' => [
0 => 'saml@example.com',
],
'roles' => [
0 => [
'employee',
'test_role',
],
],
];
}
/**
* {@inheritdoc}
*/
public function logout($redirect_path = NULL) {
$this->authenticated = FALSE;
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimplesamlphpAuthManager:: |
protected | property | The route admin context to determine whether a route is an admin one. | |
SimplesamlphpAuthManager:: |
protected | property | Attributes for federated user. | |
SimplesamlphpAuthManager:: |
protected | property | A configuration object. | |
SimplesamlphpAuthManager:: |
protected | property | The current user. | |
SimplesamlphpAuthManager:: |
protected | property | A SimpleSAML instance. | |
SimplesamlphpAuthManager:: |
protected | property | The messenger. | |
SimplesamlphpAuthManager:: |
protected | property | The module handler service. | |
SimplesamlphpAuthManager:: |
protected | property | The request stack. | |
SimplesamlphpAuthManager:: |
protected | property | A SimpleSAML configuration instance. | |
SimplesamlphpAuthManager:: |
public | function | Asks all modules if current federated user is allowed to login. | |
SimplesamlphpAuthManager:: |
protected | function | Check if the SimpleSAMLphp library can be found. | |
SimplesamlphpAuthManager:: |
public | function | Get a specific SimpleSAML attribute. | |
SimplesamlphpAuthManager:: |
public | function | Gets the unique id of the user from the IdP. | |
SimplesamlphpAuthManager:: |
public | function | Gets the mail attribute. | |
SimplesamlphpAuthManager:: |
public | function | Gets the name attribute. | |
SimplesamlphpAuthManager:: |
protected | function | Returns a SimpleSAML configuration instance. | |
SimplesamlphpAuthManager:: |
protected | function | Returns a SimpleSAML Simple class instance. | |
SimplesamlphpAuthManager:: |
public | function | Checks if SimpleSAMLphp_auth is enabled. | |
SimplesamlphpAuthManager:: |
public | function | Constructor for SimplesamlphpAuthManager. | |
SimplesamlphpAuthTestManager:: |
protected | property | Keeps track of whether the user is authenticated. | |
SimplesamlphpAuthTestManager:: |
public | function |
Forwards the user to the IdP for authentication. Overrides SimplesamlphpAuthManager:: |
|
SimplesamlphpAuthTestManager:: |
public | function |
Gets all SimpleSAML attributes. Overrides SimplesamlphpAuthManager:: |
|
SimplesamlphpAuthTestManager:: |
public | function |
Get SimpleSAMLphp storage type. Overrides SimplesamlphpAuthManager:: |
|
SimplesamlphpAuthTestManager:: |
public | function |
Check whether user is authenticated by the IdP. Overrides SimplesamlphpAuthManager:: |
|
SimplesamlphpAuthTestManager:: |
public | function |
Log a user out through the SimpleSAMLphp instance. Overrides SimplesamlphpAuthManager:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |