Skip to content
Snippets Groups Projects
Commit 115b04ac authored by Ted Cooper's avatar Ted Cooper
Browse files

[#3297262]: Theme Switcher to ensure it loads active themes as options.

parent 6afd48f8
No related branches found
No related tags found
No related merge requests found
<?php
namespace Drupal\Tests\form_mode_manager_theme_switcher\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\form_mode_manager\Functional\FormModeManagerBase;
/**
* Tests form_mode_manager_theme_switcher.
*
* @group form_mode_manager_theme_switcher
*
* @ingroup form_mode_manager
*/
class FormModeManagerThemeSwitcherTest extends FormModeManagerBase {
/**
* Modules to install.
*
* @var array
*/
protected static $modules = [
// Parent modules.
'entity_test',
'field',
'field_ui',
'media',
'block',
'block_content',
'node',
'user',
'form_mode_manager',
'taxonomy',
// Local testing requirements.
'form_mode_manager_theme_switcher',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests Theme Switcher UI availability and theme options being present.
*
* @throws \Behat\Mink\Exception\ExpectationException
*/
public function testSelectSpecificTheme() {
$this->drupalLogin($this->rootUser);
// Theme switcher UI must be available.
$this->drupalGet('admin/config/content/form_mode_manager/theme-switcher');
$this->assertSession()->statusCodeEquals(200);
// The theme Stark must have been included in the page as an option the
// created form modes on node and user.
$node_mode_select = $this->assertSession()->selectExists(
"{$this->nodeFormMode->id()}_theme_type"
);
$this->assertSession()->selectExists(
"{$this->nodeFormMode->id()}_theme_form_mode"
);
$this->assertSession()->optionExists(
"{$this->nodeFormMode->id()}_theme_form_mode",
$this->defaultTheme
);
$this->assertSession()->selectExists(
"{$this->userFormMode->id()}_theme_type"
);
$this->assertSession()->selectExists(
"{$this->userFormMode->id()}_theme_form_mode"
);
$this->assertSession()->optionExists(
"{$this->userFormMode->id()}_theme_form_mode",
$this->defaultTheme
);
}
}
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