Commit 3715b7a0 authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4957: Ensure assertTrue() always gets a Boolean

parent 05569e1a
......@@ -136,7 +136,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
'Vimeo video',
];
foreach ($elements as $element) {
$this->assertTrue($this->xpath('//input[@type="submit" and @value="Add ' . $element . ' banner"]'), 'Add banner using ' . $element);
$this->assertTrue((bool) $this->xpath('//input[@type="submit" and @value="Add ' . $element . ' banner"]'), 'Add banner using ' . $element);
}
// Check 'Settings' group.
......@@ -1614,13 +1614,13 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalGet('admin/structure/paragraphs_type/uw_para_call_to_action/fields/paragraph.uw_para_call_to_action.field_uw_cta_text_details');
$this->assertSession()->statusCodeEquals(200);
$small = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'small');
$this->assertTrue($small);
$this->assertTrue((bool) $small);
$this->assertEquals('Small', $small->getText());
$medium = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'medium');
$this->assertTrue($medium);
$this->assertTrue((bool) $medium);
$this->assertEquals('Medium', $medium->getText());
$big = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'big');
$this->assertTrue($big);
$this->assertTrue((bool) $big);
$this->assertEquals('Big', $big->getText());
$this->assertSession()->optionNotExists('default_value_input[field_uw_cta_text_details][0][style]', 'icon/image');
......@@ -1659,13 +1659,13 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Make sure the type of CTA text details doesn't include 'icon'
// when add 'call to action' block.
$small = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'small');
$this->assertTrue($small);
$this->assertTrue((bool) $small);
$this->assertEquals('Small', $small->getText());
$medium = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'medium');
$this->assertTrue($medium);
$this->assertTrue((bool) $medium);
$this->assertEquals('Medium', $medium->getText());
$big = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'big');
$this->assertTrue($big);
$this->assertTrue((bool) $big);
$this->assertEquals('Big', $big->getText());
$this->assertSession()->optionNotExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'icon/image');
......@@ -1694,7 +1694,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalGet('admin/structure/paragraphs_type/uw_para_fact_figure/fields/paragraph.uw_para_fact_figure.field_uw_ff_info');
$this->assertSession()->statusCodeEquals(200);
$smallhighlight = $this->assertSession()->optionExists('default_value_input[field_uw_ff_info][0][style]', 'small');
$this->assertTrue($smallhighlight);
$this->assertTrue((bool) $smallhighlight);
$this->assertEquals('Small highlight', $smallhighlight->getText());
// Check the configure block by adding facts and figures.
$this->drupalGet('node/1/layout');
......@@ -1722,7 +1722,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertFieldByXPath('//option[@value="org-default" and @selected="selected"]', NULL, 'Default uWaterloo is selected.');
// The type includes 'Small highlight' with value 'small'.
$smallhighlight = $this->assertSession()->optionExists('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_fact_figure][0][subform][field_uw_ff_info][0][style]', 'small');
$this->assertTrue($smallhighlight);
$this->assertTrue((bool) $smallhighlight);
$this->assertEquals('Small highlight', $smallhighlight->getText());
}
......
Supports Markdown
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