Skip to content
Snippets Groups Projects
Commit 60943351 authored by Jonathan Smith's avatar Jonathan Smith Committed by Stephen Mustgrave
Browse files

Issue #3328058: Expand the phpunit test coverage for module_filter

parent 8b6cdd5d
Branches
Tags
1 merge request!23Issue #3328058: Expand the phpunit test coverage for module_filter
'buy_f':
title: 'Buy flowers'
description: 'The description is not used for filtering'
'send':
title: 'Send flowers'
'buy_b':
title: 'Buy fruit'
<?php
namespace Drupal\Tests\module_filter\FunctionalJavascript;
/**
* Tests the Permisions tab on admin/people/permissions.
*
* @group module_filter
*/
class ModuleFilterJavascriptPermissionsTest extends ModuleFilterJavascriptTestBase {
/**
* Tests the filtering of permissions.
*/
public function testPermissionsFiltering() {
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/people/permissions');
$page = $this->getSession()->getPage();
// Check hat the test modules and their permissions are shown by default.
$assert->pageTextContains('Roses');
$assert->pageTextContains('Buy flowers');
$assert->pageTextContains('Send flowers');
$assert->pageTextContains('Banana');
$assert->pageTextContains('Buy fruit');
// Enter 'ses' as the filter and check that the Red Roses module is
// displayed and both of its permissions are displayed. Check that the other
// module and its permissions are not displayed. This shows that filtering
// works on the module's readable name.
$page->fillField('edit-text', 'ses');
$this->waitForNoText('Banana');
$assert->pageTextContains('Roses');
$assert->pageTextContains('Buy flowers');
$assert->pageTextContains('Send flowers');
$assert->pageTextNotContains('Banana');
$assert->pageTextNotContains('Buy fruit');
}
}
......@@ -51,6 +51,7 @@ abstract class ModuleFilterJavascriptTestBase extends WebDriverTestBase {
// Create an administrator user with the required permissions.
$this->adminUser = $this->drupalCreateUser([
'administer modules',
'administer permissions',
]);
$this->adminUser->set('name', 'Minnie the Admin')->save();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment