class MemberCountBlockTest in Organic groups 8
Tests the member count block.
@group og
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses AssertContentTrait, AssertLegacyTrait, AssertHelperTrait, ConfigTestTrait, PhpunitCompatibilityTrait, RandomGeneratorTrait, TestRequirementsTrait
- class \Drupal\Tests\og\Kernel\Plugin\Block\MemberCountBlockTest uses StringTranslationTrait, OgMembershipCreationTrait, UserCreationTrait
Expanded class hierarchy of MemberCountBlockTest
File
- tests/
src/ Kernel/ Plugin/ Block/ MemberCountBlockTest.php, line 22
Namespace
Drupal\Tests\og\Kernel\Plugin\BlockView source
class MemberCountBlockTest extends KernelTestBase {
use OgMembershipCreationTrait;
use StringTranslationTrait;
use UserCreationTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'block',
'entity_test',
'field',
'og',
'system',
'user',
];
/**
* The group type manager.
*
* @var \Drupal\og\GroupTypeManagerInterface
*/
protected $groupTypeManager;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The block storage handler.
*
* @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface
*/
protected $blockStorage;
/**
* The block view builder.
*
* @var \Drupal\Core\Entity\EntityViewBuilderInterface
*/
protected $blockViewBuilder;
/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;
/**
* The renderer.
*
* @var \Drupal\Core\Render\RendererInterface
*/
protected $renderer;
/**
* The render cache.
*
* @var \Drupal\Core\Render\PlaceholderingRenderCache
*/
protected $renderCache;
/**
* Test groups.
*
* @var \Drupal\entity_test\Entity\EntityTest[]
*/
protected $groups;
/**
* A test block. This is the system under test.
*
* @var \Drupal\block\BlockInterface
*/
protected $block;
/**
* The group that is considered to be "currently active" in the test.
*
* This group will be returned by the mocked OgContext service.
*
* @var \Drupal\entity_test\Entity\EntityTest
*/
protected $activeGroup;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('entity_test');
$this
->installEntitySchema('user');
$this
->installEntitySchema('og_membership');
$this
->installConfig([
'system',
'block',
'og',
]);
$this
->installSchema('system', [
'sequences',
]);
$this->groupTypeManager = $this->container
->get('og.group_type_manager');
$this->entityTypeManager = $this->container
->get('entity_type.manager');
$this->blockStorage = $this->entityTypeManager
->getStorage('block');
$this->blockViewBuilder = $this->entityTypeManager
->getViewBuilder('block');
$this->cacheTagsInvalidator = $this->container
->get('cache_tags.invalidator');
$this->renderer = $this->container
->get('renderer');
$this->renderCache = $this->container
->get('render_cache');
// The block being tested shows the member count of the currently active
// group, which it gets from OgContext. Mock OgContext using a callback to
// set the active group that will be used during the test.
$og_context = $this
->prophesize(OgContextInterface::class);
$og_context
->getGroup()
->will(new CallbackPromise([
$this,
'getActiveGroup',
]));
$this->container
->set('og.context', $og_context
->reveal());
// Create a group type.
$this->groupTypeManager
->addGroup('entity_test', 'group');
// Create two test groups.
for ($i = 0; $i < 2; $i++) {
$this->groups[$i] = EntityTest::create([
'type' => 'group',
'name' => $this
->randomString(),
]);
$this->groups[$i]
->save();
}
// Create a test block.
$this->block = $this->blockStorage
->create([
'plugin' => 'og_member_count',
'region' => 'sidebar_first',
'id' => 'group_member_count',
'theme' => $this
->config('system.theme')
->get('default'),
'label' => 'Group member count',
'visibility' => [],
'weight' => 0,
]);
$this->block
->save();
}
/**
* Tests the member count block.
*/
public function testMemberCountBlock() {
// Before the blocks are rendered for the first time, no cache entries
// should exist for them. We have two groups, so let's test both blocks.
$this
->assertNotCached(0);
$this
->assertNotCached(1);
// After rendering the first block, only this block should be cached, the
// other should be unaffected.
$this
->renderBlock(0);
$this
->assertCached(0);
$this
->assertNotCached(1);
$this
->renderBlock(1);
$this
->assertCached(1);
// Initially the blocks should have 0 members.
$this
->assertMemberCount(0, 0);
$this
->assertMemberCount(1, 0);
// In the default configuration the block should only count active users,
// and ignore blocked and pending users. Also check that making changes to
// the members of the group only invalidates the cache of the related block.
$this
->addMember(0, OgMembershipInterface::STATE_BLOCKED);
$this
->addMember(0, OgMembershipInterface::STATE_PENDING);
$this
->assertNotCached(0);
$this
->assertCached(1);
$this
->assertMemberCount(0, 0);
// However adding an active user increases the member count.
$active_membership = $this
->addMember(0, OgMembershipInterface::STATE_ACTIVE);
$this
->assertMemberCount(0, 1);
// If we block the active user, the member count should be updated
// accordingly.
$active_membership
->setState(OgMembershipInterface::STATE_BLOCKED)
->save();
$this
->assertMemberCount(0, 0);
// Check that both blocks are invalidated when the block settings are
// changed.
$this
->updateBlockSetting('count_pending_users', TRUE);
$this
->assertNotCached(0);
$this
->assertNotCached(1);
// The block has now been configured to also count pending members. Check if
// the count is updated accordingly.
$this
->assertMemberCount(0, 1);
$this
->assertMemberCount(1, 0);
// Turn on the counting of blocked members and check the resulting value.
$this
->updateBlockSetting('count_blocked_users', TRUE);
$this
->assertMemberCount(0, 3);
$this
->assertMemberCount(1, 0);
// Now delete one of the memberships of the first group. This should
// decrease the counter.
$active_membership
->delete();
$this
->assertMemberCount(0, 2);
// Since the deletion of the user only affected the first group, the block
// of the second group should still be unchanged and happily cached.
$this
->assertCached(1);
$this
->assertMemberCount(1, 0);
// For good measure, try to add a user to the second group and check that
// all is in order.
$this
->addMember(1, OgMembershipInterface::STATE_ACTIVE);
$this
->assertMemberCount(1, 1);
// The block from the first group should not be affected by this.
$this
->assertCached(0);
$this
->assertMemberCount(0, 2);
}
/**
* Renders the block using the passed in group as the currently active group.
*
* @param int $group_key
* The key of the group to set as active group.
*
* @return string
* The content of the block rendered as HTML.
*/
protected function renderBlock($group_key) {
// Clear the static caches of the cache tags invalidators. The invalidators
// will only invalidate cache tags once per request to improve performance.
// Unfortunately they can not distinguish between an actual Drupal page
// request and a PHPUnit test that simulates visiting multiple pages.
// We are pretending that every time this method is called a new page has
// been requested, and the static caches are empty.
$this->cacheTagsInvalidator
->resetChecksums();
$this->activeGroup = $this->groups[$group_key];
$render_array = $this->blockViewBuilder
->view($this->block);
$html = $this->renderer
->renderRoot($render_array);
// At all times, after a block is rendered, it should be cached.
$this
->assertCached($group_key);
return $html;
}
/**
* Checks that the block shows the correct member count for the given group.
*
* @param int $group_key
* The key of the group for which to check the block.
* @param int $expected_count
* The number of members that are expected to be shown in the block.
*/
protected function assertMemberCount($group_key, $expected_count) {
$expected_string = (string) $this
->formatPlural($expected_count, '@label has 1 member.', '@label has @count members', [
'@label' => $this->groups[$group_key]
->label(),
]);
// @todo Use assertStringContainsString() once we are on PHPUnit 9.
$this
->assertTrue(strpos((string) $this
->renderBlock($group_key), $expected_string) !== FALSE);
}
/**
* Adds a member with the given membership state to the given group.
*
* @param int $group_key
* The key of the group to which a member should be added.
* @param string $state
* The membership state to assign to the newly added member.
*
* @return \Drupal\og\OgMembershipInterface
* The membership entity for the newly added member.
*/
protected function addMember($group_key, $state) {
$user = $this
->createUser();
return $this
->createOgMembership($this->groups[$group_key], $user, NULL, $state);
}
/**
* Updates the given setting in the block with the given value.
*
* @param string $setting
* The setting to update.
* @param mixed $value
* The value to set.
*
* @throws \Drupal\Core\Entity\EntityStorageException
* Thrown when the updated block cannot be saved.
*/
protected function updateBlockSetting($setting, $value) {
$settings = $this->block
->get('settings');
$settings[$setting] = $value;
$this->block
->set('settings', $settings)
->save();
}
/**
* Checks that the block is cached for the given group.
*
* @param int $group_key
* The key of the group for which to check the block cache status.
*/
protected function assertCached($group_key) {
$this
->doAssertCached('assertNotEmpty', $group_key);
}
/**
* Checks that the block is not cached for the given group.
*
* @param int $group_key
* The key of the group for which to check the block cache status.
*/
protected function assertNotCached($group_key) {
$this
->doAssertCached('assertEmpty', $group_key);
}
/**
* Checks the cache status of the block for the given group.
*
* @param string $assert_method
* The method to use for asserting that the block is cached or not cached.
* @param int $group_key
* The key of the group for which to check the block cache status.
*/
protected function doAssertCached($assert_method, $group_key) {
// We will switch the currently active context so that the right cache
// contexts are available for the render cache. Keep track of the currently
// active group so we can restore it after checking the cache status.
$original_active_group = $this->activeGroup;
$this->activeGroup = $this->groups[$group_key];
// Retrieve the block to render, and apply the required cache contexts that
// are also applied when RendererInterface::renderRoot() is executed. This
// ensures that we pass the same cache information to the render cache as is
// done when actually rendering the HTML root.
$render_array = $this->blockViewBuilder
->view($this->block);
$render_array['#cache']['contexts'] = Cache::mergeContexts($render_array['#cache']['contexts'], $this->container
->getParameter('renderer.config')['required_cache_contexts']);
// Retrieve the cached data and perform the assertion.
$cached_data = $this->renderCache
->get($render_array);
$this
->{$assert_method}($cached_data);
// Restore the active group.
$this->activeGroup = $original_active_group;
}
/**
* Callback providing the active group to be returned by the mocked OgContext.
*
* @return \Drupal\entity_test\Entity\EntityTest
* The active group.
*/
public function getActiveGroup() {
return $this->activeGroup;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AssertContentTrait:: |
protected | property | The current raw content. | |
AssertContentTrait:: |
protected | property | The drupalSettings value from the current raw $content. | |
AssertContentTrait:: |
protected | property | The XML structure parsed from the current raw $content. | 1 |
AssertContentTrait:: |
protected | property | The plain-text content of raw $content (text nodes). | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page by the given XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page with a given Xpath result. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is found. | |
AssertContentTrait:: |
protected | function | Asserts that each HTML ID is used for just a single element. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS NOT found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist or its value does not match, by XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href is not found in the main region. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page does not exist. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the perl regex pattern is not found in raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text is NOT found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) does not contains the text. | |
AssertContentTrait:: |
protected | function | Pass if the page title is not the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found MORE THAN ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Asserts that a select option with the visible text exists. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the Perl regex pattern is found in the raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) contains the text. | |
AssertContentTrait:: |
protected | function | Helper for assertText and assertNoText. | |
AssertContentTrait:: |
protected | function | Asserts that a Perl regex pattern is found in the plain-text content. | |
AssertContentTrait:: |
protected | function | Asserts themed output. | |
AssertContentTrait:: |
protected | function | Pass if the page title is the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found ONLY ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Helper for assertUniqueText and assertNoUniqueText. | |
AssertContentTrait:: |
protected | function | Builds an XPath query. | |
AssertContentTrait:: |
protected | function | Helper: Constructs an XPath for the given set of attributes and value. | |
AssertContentTrait:: |
protected | function | Searches elements using a CSS selector in the raw content. | |
AssertContentTrait:: |
protected | function | Get all option elements, including nested options, in a select. | |
AssertContentTrait:: |
protected | function | Gets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Gets the current raw content. | |
AssertContentTrait:: |
protected | function | Get the selected value from a select field. | |
AssertContentTrait:: |
protected | function | Retrieves the plain-text content from the current raw content. | |
AssertContentTrait:: |
protected | function | Get the current URL from the cURL handler. | 1 |
AssertContentTrait:: |
protected | function | Parse content returned from curlExec using DOM and SimpleXML. | |
AssertContentTrait:: |
protected | function | Removes all white-space between HTML tags from the raw content. | |
AssertContentTrait:: |
protected | function | Sets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Sets the raw content (e.g. HTML). | |
AssertContentTrait:: |
protected | function | Performs an xpath search on the contents of the internal browser. | |
AssertHelperTrait:: |
protected static | function | Casts MarkupInterface objects into strings. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertSame() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertNotEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertNotSame() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() instead. | |
AssertLegacyTrait:: |
protected | function | ||
ConfigTestTrait:: |
protected | function | Returns a ConfigImporter object to import test configuration. | |
ConfigTestTrait:: |
protected | function | Copies configuration objects from source storage to target storage. | |
KernelTestBase:: |
protected | property | Back up and restore any global variables that may be changed by tests. | |
KernelTestBase:: |
protected | property | Back up and restore static class properties that may be changed by tests. | |
KernelTestBase:: |
protected | property | Contains a few static class properties for performance. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | @todo Move into Config test base class. | 7 |
KernelTestBase:: |
protected static | property | An array of config object names that are excluded from schema checking. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | Do not forward any global state from the parent process to the processes that run the actual tests. | |
KernelTestBase:: |
protected | property | The app root. | |
KernelTestBase:: |
protected | property | Kernel tests are run in separate processes because they allow autoloading of code from extensions. Running the test in a separate process isolates this behavior from other tests. Subclasses should not override this property. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | Set to TRUE to strict check all configuration saved. | 6 |
KernelTestBase:: |
protected | property | The virtual filesystem root directory. | |
KernelTestBase:: |
protected | function | 1 | |
KernelTestBase:: |
protected | function | Bootstraps a basic test environment. | |
KernelTestBase:: |
private | function | Bootstraps a kernel for a test. | |
KernelTestBase:: |
protected | function | Configuration accessor for tests. Returns non-overridden configuration. | |
KernelTestBase:: |
protected | function | Disables modules for this test. | |
KernelTestBase:: |
protected | function | Enables modules for this test. | |
KernelTestBase:: |
protected | function | Gets the config schema exclusions for this test. | |
KernelTestBase:: |
protected | function | Returns the Database connection info to be used for this test. | 1 |
KernelTestBase:: |
public | function | ||
KernelTestBase:: |
private | function | Returns Extension objects for $modules to enable. | |
KernelTestBase:: |
private static | function | Returns the modules to enable for this test. | |
KernelTestBase:: |
protected | function | Initializes the FileCache component. | |
KernelTestBase:: |
protected | function | Installs default configuration for a given list of modules. | |
KernelTestBase:: |
protected | function | Installs the storage schema for a specific entity type. | |
KernelTestBase:: |
protected | function | Installs database tables from a module schema definition. | |
KernelTestBase:: |
protected | function | Returns whether the current test method is running in a separate process. | |
KernelTestBase:: |
protected | function | ||
KernelTestBase:: |
public | function |
Registers test-specific services. Overrides ServiceProviderInterface:: |
26 |
KernelTestBase:: |
protected | function | Renders a render array. | 1 |
KernelTestBase:: |
protected | function | Sets the install profile and rebuilds the container to update it. | |
KernelTestBase:: |
protected | function | Sets an in-memory Settings variable. | |
KernelTestBase:: |
public static | function | 1 | |
KernelTestBase:: |
protected | function | Sets up the filesystem, so things like the file directory. | 2 |
KernelTestBase:: |
protected | function | Stops test execution. | |
KernelTestBase:: |
protected | function | 6 | |
KernelTestBase:: |
public | function | @after | |
KernelTestBase:: |
protected | function | Dumps the current state of the virtual filesystem to STDOUT. | |
KernelTestBase:: |
public | function | BC: Automatically resolve former KernelTestBase class properties. | |
KernelTestBase:: |
public | function | Prevents serializing any properties. | |
MemberCountBlockTest:: |
protected | property | The group that is considered to be "currently active" in the test. | |
MemberCountBlockTest:: |
protected | property | A test block. This is the system under test. | |
MemberCountBlockTest:: |
protected | property | The block storage handler. | |
MemberCountBlockTest:: |
protected | property | The block view builder. | |
MemberCountBlockTest:: |
protected | property | The cache tags invalidator. | |
MemberCountBlockTest:: |
protected | property | The entity type manager. | |
MemberCountBlockTest:: |
protected | property | Test groups. | |
MemberCountBlockTest:: |
protected | property | The group type manager. | |
MemberCountBlockTest:: |
protected static | property |
Modules to enable. Overrides KernelTestBase:: |
|
MemberCountBlockTest:: |
protected | property | The render cache. | |
MemberCountBlockTest:: |
protected | property | The renderer. | |
MemberCountBlockTest:: |
protected | function | Adds a member with the given membership state to the given group. | |
MemberCountBlockTest:: |
protected | function | Checks that the block is cached for the given group. | |
MemberCountBlockTest:: |
protected | function | Checks that the block shows the correct member count for the given group. | |
MemberCountBlockTest:: |
protected | function | Checks that the block is not cached for the given group. | |
MemberCountBlockTest:: |
protected | function | Checks the cache status of the block for the given group. | |
MemberCountBlockTest:: |
public | function | Callback providing the active group to be returned by the mocked OgContext. | |
MemberCountBlockTest:: |
protected | function | Renders the block using the passed in group as the currently active group. | |
MemberCountBlockTest:: |
protected | function |
Overrides KernelTestBase:: |
|
MemberCountBlockTest:: |
public | function | Tests the member count block. | |
MemberCountBlockTest:: |
protected | function | Updates the given setting in the block with the given value. | |
OgMembershipCreationTrait:: |
protected | function | Creates a test membership. | |
PhpunitCompatibilityTrait:: |
public | function | Returns a mock object for the specified class using the available method. | |
PhpunitCompatibilityTrait:: |
public | function | Compatibility layer for PHPUnit 6 to support PHPUnit 4 code. | |
RandomGeneratorTrait:: |
protected | property | The random generator. | |
RandomGeneratorTrait:: |
protected | function | Gets the random generator for the utility methods. | |
RandomGeneratorTrait:: |
protected | function | Generates a unique random string containing letters and numbers. | 1 |
RandomGeneratorTrait:: |
public | function | Generates a random PHP object. | |
RandomGeneratorTrait:: |
public | function | Generates a pseudo-random string of ASCII characters of codes 32 to 126. | |
RandomGeneratorTrait:: |
public | function | Callback for random string validation. | |
StorageCopyTrait:: |
protected static | function | Copy the configuration from one storage to another and remove stale items. | |
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. | |
TestRequirementsTrait:: |
private | function | Checks missing module requirements. | |
TestRequirementsTrait:: |
protected | function | Check module requirements for the Drupal use case. | 1 |
TestRequirementsTrait:: |
protected static | function | Returns the Drupal root directory. | |
UserCreationTrait:: |
protected | function | Checks whether a given list of permission names is valid. | |
UserCreationTrait:: |
protected | function | Creates an administrative role. | |
UserCreationTrait:: |
protected | function | Creates a role with specified permissions. | |
UserCreationTrait:: |
protected | function | Create a user with a given set of permissions. | |
UserCreationTrait:: |
protected | function | Grant permissions to a user role. | |
UserCreationTrait:: |
protected | function | Switch the current logged in user. | |
UserCreationTrait:: |
protected | function | Creates a random user account and sets it as current user. |