You are here

final class TestTeamPermissions in Apigee Edge 8

Provides dynamic team permissions for testing.

Hierarchy

Expanded class hierarchy of TestTeamPermissions

1 string reference to 'TestTeamPermissions'
apigee_edge_teams_test.team_permissions.yml in modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/apigee_edge_teams_test.team_permissions.yml
modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/apigee_edge_teams_test.team_permissions.yml

File

modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/src/TestTeamPermissions.php, line 33

Namespace

Drupal\apigee_edge_teams_test
View source
final class TestTeamPermissions implements DynamicTeamPermissionProviderInterface, ContainerInjectionInterface {
  use StringTranslationTrait;

  /**
   * TestTeamPermissions constructor.
   *
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The string translation.
   */
  public function __construct(TranslationInterface $string_translation) {
    $this->stringTranslation = $string_translation;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('string_translation'));
  }

  /**
   * {@inheritdoc}
   */
  public function permissions() : array {
    return [
      new TeamPermission('test team permission 3', $this
        ->t('Team permission test 3'), $this
        ->t('Team permission test'), $this
        ->t('This is the 3rd team test permission.')),
      new TeamPermission('test team permission 4', $this
        ->t('Team permission test 4'), $this
        ->t('Team permission test')),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TestTeamPermissions::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
TestTeamPermissions::permissions public function Returns team permissions provided by a module. Overrides DynamicTeamPermissionProviderInterface::permissions
TestTeamPermissions::__construct public function TestTeamPermissions constructor.