Commit 30cdbcdb authored by Martin Keereman's avatar Martin Keereman
Browse files

Issue #3136214 by novchuk.v: Replace assertEqual() or assertSame() on two...

Issue #3136214 by novchuk.v: Replace assertEqual() or assertSame() on two calls to count() with assertCount()
parent 04134b7a
......@@ -39,7 +39,7 @@ class BetterExposedFiltersKernelTest extends BetterExposedFiltersKernelTestBase
// Check our "submit" button is hidden.
$actual = $this->xpath("//form//input[@type='submit'][contains(concat(' ',normalize-space(@class),' '),' js-hide ')]");
$this->assertEqual(count($actual), 1, 'Submit button was hidden successfully.');
$this->assertCount(1, $actual, 'Submit button was hidden successfully.');
$view->destroy();
}
......@@ -64,7 +64,7 @@ class BetterExposedFiltersKernelTest extends BetterExposedFiltersKernelTestBase
// Assert our "secondary" options detail is hidden if no fields are placed.
$actual = $this->xpath("//form//details[@id='edit-secondary']");
$this->assertEqual(count($actual), 0, 'Secondary options are hidden because no fields were placed.');
$this->assertCount(0, $actual, 'Secondary options are hidden because no fields were placed.');
$view->destroy();
......@@ -103,19 +103,19 @@ class BetterExposedFiltersKernelTest extends BetterExposedFiltersKernelTestBase
// Assert our "secondary" options detail is visible.
$actual = $this->xpath("//form//details[@id='edit-secondary']");
$this->assertEqual(count($actual), 1, 'Secondary options is visible.');
$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']");
$this->assertEqual(count($actual), 1, 'Exposed sort was placed in secondary fieldset.');
$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']");
$this->assertEqual(count($actual), 1, 'Exposed pager was placed in secondary fieldset.');
$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']");
$this->assertEqual(count($actual), 1, 'Exposed filter "field_bef_boolean" was placed in secondary fieldset.');
$this->assertCount(1, $actual, 'Exposed filter "field_bef_boolean" was placed in secondary fieldset.');
$view->destroy();
}
......
......@@ -137,7 +137,7 @@ class FilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Assert our "collapsible" options detail is visible.
$actual = $this->xpath("//form//details[@id='edit-field-bef-email-value-collapsible']");
$this->assertEqual(count($actual), 1, '"Field BEF Email" option is displayed as collapsible fieldset.');
$this->assertCount(1, $actual, '"Field BEF Email" option is displayed as collapsible fieldset.');
$view->destroy();
}
......
......@@ -40,7 +40,7 @@ class HiddenFilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our "FIELD_BEF_BOOLEAN" filter is rendered as a hidden element.
$actual = $this->xpath('//form//input[@type="hidden" and starts-with(@name, "field_bef_boolean_value")]');
$this->assertEqual(count($actual), 1, 'Exposed filter "FIELD_BEF_BOOLEAN" is hidden.');
$this->assertCount(1, $actual, 'Exposed filter "FIELD_BEF_BOOLEAN" is hidden.');
$view->destroy();
}
......@@ -69,10 +69,10 @@ class HiddenFilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our "FIELD_BEF_INTEGER" filter is rendered as a hidden element.
$actual = $this->xpath('//form//label[@type="label" and starts-with(@for, "edit-field-bef-integer-value")]');
$this->assertEqual(count($actual), 0, 'Exposed filter "FIELD_BEF_INTEGER" is hidden.');
$this->assertCount(0, $actual, 'Exposed filter "FIELD_BEF_INTEGER" is hidden.');
$actual = $this->xpath('//form//input[@type="hidden" and starts-with(@name, "field_bef_integer_value")]');
$this->assertEqual(count($actual), 0, 'Exposed filter "FIELD_BEF_INTEGER" has no selected values.');
$this->assertCount(0, $actual, 'Exposed filter "FIELD_BEF_INTEGER" has no selected values.');
}
}
......@@ -47,20 +47,20 @@ class LinksFilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our "FIELD_BEF_INTEGER" filter is rendered as links.
$actual = $this->xpath('//form//a[starts-with(@name, "field_bef_integer_value")]');
$this->assertEqual(count($actual), 6, 'Exposed filter "FIELD_BEF_INTEGER" has correct number of exposed links.');
$this->assertCount(6, $actual, 'Exposed filter "FIELD_BEF_INTEGER" has correct number of exposed links.');
// Check our "TERM_NODE_TID_DEPTH" filter is rendered as nested links.
$actual = $this->xpath("//form//div[contains(concat(' ',normalize-space(@class),' '),' bef-nested ')]");
$this->assertEqual(count($actual), 1, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
$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")]');
$this->assertEqual(count($actual), 4, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level links.');
$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")]');
$this->assertEqual(count($actual), 5, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level links.');
$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")]');
$this->assertEqual(count($actual), 14, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level links.');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level links.');
$view->destroy();
}
......
......@@ -50,20 +50,20 @@ class RadioButtonsFilterWidgetKernelTest extends BetterExposedFiltersKernelTestB
// Check our "FIELD_BEF_INTEGER" filter is rendered as checkboxes.
$actual = $this->xpath('//form//input[@type="checkbox" and starts-with(@name, "field_bef_integer_value")]');
$this->assertEqual(count($actual), 5, 'Exposed filter "FIELD_BEF_INTEGER" has correct number of exposed checkboxes.');
$this->assertCount(5, $actual, 'Exposed filter "FIELD_BEF_INTEGER" has correct number of exposed checkboxes.');
// Check our "TERM_NODE_TID_DEPTH" filter is rendered as nested checkboxes.
$actual = $this->xpath("//form//div[contains(concat(' ',normalize-space(@class),' '),' bef-nested ')]");
$this->assertEqual(count($actual), 1, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
$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")]');
$this->assertEqual(count($actual), 3, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level checkboxes.');
$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")]');
$this->assertEqual(count($actual), 5, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level checkboxes.');
$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")]');
$this->assertEqual(count($actual), 14, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level checkboxes.');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level checkboxes.');
$view->destroy();
}
......@@ -96,23 +96,23 @@ class RadioButtonsFilterWidgetKernelTest extends BetterExposedFiltersKernelTestB
// Check our filter is rendered as radio buttons (i.e. Any, true, false).
$actual = $this->xpath('//form//input[@type="radio" and @name="field_bef_boolean_value"]');
$this->assertEqual(count($actual), 3, 'Exposed filter "FIELD_BEF_BOOLEAN" renders as radio buttons.');
$this->assertCount(3, $actual, 'Exposed filter "FIELD_BEF_BOOLEAN" renders as radio buttons.');
// Check our "TERM_NODE_TID_DEPTH" filter is rendered as nested radio
// buttons.
$actual = $this->xpath("//form//div[contains(concat(' ',normalize-space(@class),' '),' bef-nested ')]");
$this->assertEqual(count($actual), 1, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
$this->assertCount(1, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has bef-nested class');
// 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")]');
$this->assertEqual(count($actual), 4, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed top-level radio buttons.');
$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")]');
$this->assertEqual(count($actual), 5, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed second-level radio buttons.');
$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")]');
$this->assertEqual(count($actual), 14, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level radio buttons.');
$this->assertCount(14, $actual, 'Exposed filter "TERM_NODE_TID_DEPTH" has correct number of exposed third-level radio buttons.');
$view->destroy();
}
......
......@@ -41,7 +41,7 @@ class SingleFilterWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our "FIELD_BEF_BOOLEAN" filter is rendered as a single checkbox.
$actual = $this->xpath('//form//input[@type="checkbox" and starts-with(@name, "field_bef_boolean_value")]');
$this->assertEqual(count($actual), 1, 'Exposed filter "FIELD_BEF_BOOLEAN" is rendered as a checkbox.');
$this->assertCount(1, $actual, 'Exposed filter "FIELD_BEF_BOOLEAN" is rendered as a checkbox.');
$view->destroy();
}
......
......@@ -42,7 +42,7 @@ class LinksPagerWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our pager item "items_per_page" is rendered as links.
$actual = $this->xpath('//form//a[starts-with(@name, "items_per_page")]');
$this->assertEqual(count($actual), 4, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$this->assertCount(4, $actual, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$view->destroy();
}
......
......@@ -42,7 +42,7 @@ class RadioButtonsPagerWidgetKernelTest extends BetterExposedFiltersKernelTestBa
// Check our pager item "items_per_page" is rendered as radio buttons.
$actual = $this->xpath('//form//input[@type="radio" and starts-with(@name, "items_per_page")]');
$this->assertEqual(count($actual), 4, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$this->assertCount(4, $actual, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$view->destroy();
}
......
......@@ -38,11 +38,11 @@ class LinksSortWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
// Check our sort item "sort_by" is rendered as links.
$actual = $this->xpath('//form//a[starts-with(@id, "edit-sort-by")]');
$this->assertEqual(count($actual), 1, 'Exposed sort "sort_by" has correct number of exposed links.');
$this->assertCount(1, $actual, 'Exposed sort "sort_by" has correct number of exposed links.');
// Check our sort item "sort_order" is rendered as links.
$actual = $this->xpath('//form//a[starts-with(@id, "edit-sort-order")]');
$this->assertEqual(count($actual), 2, 'Exposed sort "sort_order" has correct number of exposed links.');
$this->assertCount(2, $actual, 'Exposed sort "sort_order" has correct number of exposed links.');
$view->destroy();
}
......
......@@ -38,11 +38,11 @@ class RadioButtonsSortWidgetKernelTest extends BetterExposedFiltersKernelTestBas
// Check our sort item "sort_by" is rendered as links.
$actual = $this->xpath('//form//input[@type="radio" and starts-with(@id, "edit-sort-by")]');
$this->assertEqual(count($actual), 1, 'Exposed sort "sort_by" has correct number of exposed radio buttons.');
$this->assertCount(1, $actual, 'Exposed sort "sort_by" has correct number of exposed radio buttons.');
// Check our sort item "sort_order" is rendered as links.
$actual = $this->xpath('//form//input[@type="radio" and starts-with(@id, "edit-sort-order")]');
$this->assertEqual(count($actual), 2, 'Exposed sort "sort_order" has correct number of exposed radio buttons.');
$this->assertCount(2, $actual, 'Exposed sort "sort_order" has correct number of exposed 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