Commit 7c3ead39 authored by Martin Keereman's avatar Martin Keereman
Browse files

Issue #3149711 by Etroid: Fix tests to support 8.9

parent 869d76c6
......@@ -63,7 +63,7 @@ class BetterExposedFiltersKernelTest extends BetterExposedFiltersKernelTestBase
$this->renderExposedForm($view);
// Assert our "secondary" options detail is hidden if no fields are placed.
$actual = $this->xpath("//form//details[@id='edit-secondary']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-secondary']");
$this->assertCount(0, $actual, 'Secondary options are hidden because no fields were placed.');
$view->destroy();
......@@ -102,19 +102,19 @@ class BetterExposedFiltersKernelTest extends BetterExposedFiltersKernelTestBase
$this->renderExposedForm($view);
// Assert our "secondary" options detail is visible.
$actual = $this->xpath("//form//details[@id='edit-secondary']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-secondary']");
$this->assertCount(1, $actual, 'Secondary options is visible.');
// Assert sort option was placed in secondary details.
$actual = $this->xpath("//form//details[@id='edit-secondary']//select[@name='sort_by']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-secondary']//select[@name='sort_by']");
$this->assertCount(1, $actual, 'Exposed sort was placed in secondary fieldset.');
// Assert pager option was placed in secondary details.
$actual = $this->xpath("//form//details[@id='edit-secondary']//select[@name='items_per_page']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-secondary']//select[@name='items_per_page']");
$this->assertCount(1, $actual, 'Exposed pager was placed in secondary fieldset.');
// Assert filter option was placed in secondary details.
$actual = $this->xpath("//form//details[@id='edit-secondary']//select[@name='field_bef_boolean_value']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-secondary']//select[@name='field_bef_boolean_value']");
$this->assertCount(1, $actual, 'Exposed filter "field_bef_boolean" was placed in secondary fieldset.');
$view->destroy();
......
......@@ -136,7 +136,7 @@ class FilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
$this->renderExposedForm($view);
// Assert our "collapsible" options detail is visible.
$actual = $this->xpath("//form//details[@id='edit-field-bef-email-value-collapsible']");
$actual = $this->xpath("//form//details[@data-drupal-selector='edit-field-bef-email-value-collapsible']");
$this->assertCount(1, $actual, '"Field BEF Email" option is displayed as collapsible fieldset.');
$view->destroy();
......
......@@ -53,13 +53,13 @@ class LinksFilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
$actual = $this->xpath("//form//div[contains(concat(' ',normalize-space(@class),' '),' bef-nested ')]");
$this->assertCount(1, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(4, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level links.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/ul/li/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/ul/li/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(5, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level links.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/ul/li/ul/li/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/ul/li/ul/li/ul/li/a[starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level links.');
$view->destroy();
......
......@@ -56,13 +56,13 @@ class RadioButtonsFilterWidgetKernelTest extends BetterExposedFiltersKernelTestB
$actual = $this->xpath("//form//div[contains(concat(' ',normalize-space(@class),' '),' bef-nested ')]");
$this->assertCount(1, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(3, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level checkboxes.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(5, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level checkboxes.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/ul/li/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/ul/li/ul/li/div/input[@type="checkbox" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level checkboxes.');
$view->destroy();
......@@ -105,13 +105,13 @@ class RadioButtonsFilterWidgetKernelTest extends BetterExposedFiltersKernelTestB
// The difference with checkboxes is that radio buttons render an additoinal
// top level option (i.e. any).
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(4, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level radio buttons.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(5, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level radio buttons.');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth"]/div/ul/li/ul/li/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$actual = $this->xpath('//form//div[@id="edit-term-node-tid-depth--2"]/div/ul/li/ul/li/ul/li/div/input[@type="radio" and starts-with(@name, "term_node_tid_depth")]');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level radio buttons.');
$view->destroy();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment