Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Use $defaultTheme for using views_test_classy_subtheme in Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAjaxRebuild()
as requested by @larowlan on #3067386-31: AJAX rebuild of Views UI form re-renders parts of the form without using Form API, so additional hooks are needed in lieu of hook_form_view_edit_form_alter():
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php @@ -122,4 +122,29 @@ protected function toggleContextualTriggerVisibility($selector) { + public function testAjaxRebuild() { + \Drupal::service('theme_installer')->install(['views_test_classy_subtheme']); + + $this->config('system.theme') + ->set('default', 'views_test_classy_subtheme') + ->save();
now we have support for setting the default theme via a test-class property, should we split this into its own class and make use of that property?
Comment | File | Size | Author |
---|---|---|---|
#8 | 3088234-testfix-8.patch | 3.81 KB | tim.plunkett |
#2 | 3088234-testfix-2.patch | 3.53 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettDidn't know about this property, that's nice!
Comment #3
LendudeLooks good, one question:
Any reason for the change from content to people?
Comment #8
tim.plunkettThe change is needed because the other test had other views installed that aren't on by default.
Rerolled due to stale context
Comment #10
smustgrave CreditAttribution: smustgrave at Mobomo commentedLooks good to me looking at the patch. Verified it still applies on 9.5 too
Comment #11
alexpottCommitted and pushed 3388371b4c to 10.1.x and 6c3f82219e to 10.0.x and a9edcb0db4 to 9.5.x and 86d33bd032 to 9.4.x. Thanks!
Backported to 9.4.x because this is a test only change and keeping tests aligned is helpful.