class TestAuthenticationProvider

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php \Drupal\Tests\Core\Authentication\TestAuthenticationProvider
  2. 8.9.x core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php \Drupal\Tests\Core\Authentication\TestAuthenticationProvider
  3. 11.x core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php \Drupal\Tests\Core\Authentication\TestAuthenticationProvider

A simple provider for unit testing AuthenticationCollector.

Hierarchy

Expanded class hierarchy of TestAuthenticationProvider

File

core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php, line 59

Namespace

Drupal\Tests\Core\Authentication
View source
class TestAuthenticationProvider implements AuthenticationProviderInterface {
  
  /**
   * The provider id.
   *
   * @var string
   */
  public $providerId;
  
  /**
   * Constructor.
   */
  public function __construct($provider_id) {
    $this->providerId = $provider_id;
  }
  
  /**
   * {@inheritdoc}
   */
  public function applies(Request $request) {
    return TRUE;
  }
  
  /**
   * {@inheritdoc}
   */
  public function authenticate(Request $request) {
    return NULL;
  }

}

Members

Title Sort descending Modifiers Object type Summary
TestAuthenticationProvider::$providerId public property The provider id.
TestAuthenticationProvider::applies public function
TestAuthenticationProvider::authenticate public function
TestAuthenticationProvider::__construct public function Constructor.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.