$this->
assertSession()->
pageTextContains('The Experimental test theme has been installed.'
);
// Setting it as the default should not ask for another confirmation.
$this->
cssSelect('a[title="Set Experimental test as default theme"]'
)[0
]->
click();
$this->
assertSession()->
pageTextNotContains('Experimental themes are provided for testing purposes only. Use at your own risk.'
);
$this->
assertSession()->
pageTextContains('Experimental test is now the default theme.'
);
$this->
assertSession()->
pageTextNotContains(sprintf('Experimental test %s (experimental theme)', \Drupal::VERSION
));
$this->
assertSession()->
responseContains(sprintf('Experimental test %s (default theme, administration theme, experimental theme)', \Drupal::VERSION
));
// Uninstall the theme.
$this->
config('system.theme'
)->
set('default', 'test_theme'
)->
save();
\Drupal::
service('theme_handler'
)->
refreshInfo();
\Drupal::
service('theme_installer'
)->
uninstall(['experimental_theme_test'
]);
// Reinstall the same experimental theme, but this time immediately set it
// as the default. This should again trigger a confirmation form with an
// experimental warning.
$this->
drupalGet('admin/appearance'
);
$this->
cssSelect('a[title="Install Experimental test as default theme"]'
)[0
]->
click();
$this->
assertSession()->
pageTextContains('Experimental themes are provided for testing purposes only. Use at your own risk.'
);
// Test enabling a theme that is not itself experimental, but that depends
// on an experimental module.