Skip to content
Snippets Groups Projects
Commit ef117857 authored by David Suissa's avatar David Suissa
Browse files

Issue #3466743 by DYdave: Added initial automated tests for the 'AdminToolbarToolsSettingsForm'.

parent b58c6134
No related branches found
No related tags found
1 merge request!96Issue #3466743 by DYdave: Fixed fatal error 'Call to undefined method...
Pipeline #426707 passed with warnings
<?php
namespace Drupal\Tests\admin_toolbar_tools\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Test the Admin Toolbar settings form.
*
* @group admin_toolbar
*/
class AdminToolbarToolsSettingsFormTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $modules = [
'admin_toolbar_tools',
];
/**
* A user with access to the Admin Toolbar settings form permission.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$permissions = [
'access toolbar',
'access administration pages',
'administer site configuration',
];
$this->adminUser = $this->drupalCreateUser($permissions);
}
/**
* Test backend Admin Toolbar Tools settings form fields and submission.
*/
public function testAdminToolbarToolsSettingsForm(): void {
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
// Log in as an admin user to test admin pages.
$this->drupalLogin($this->adminUser);
// Test the 'Admin Toolbar settings' page form submission and fields.
$this->drupalGet('admin/config/user-interface/admin-toolbar-tools');
$this->submitForm([], 'Save configuration');
$assert->pageTextContains('The configuration options have been saved.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment