Check for null values when getting CMS tab elements

This commit is contained in:
Robbie Averill 2017-07-17 10:11:59 +12:00
parent 2dd5bb4d19
commit a8b3da6958

View File

@ -243,7 +243,9 @@ class CmsUiContext implements Context
*/
public function theHeaderTabShouldBeActive($text)
{
assertTrue($this->getCmsTabElement($text)->hasClass('active'));
$element = $this->getCmsTabElement($text);
assertNotNull($element);
assertTrue($element->hasClass('active'));
}
/**
@ -251,7 +253,9 @@ class CmsUiContext implements Context
*/
public function theHeaderTabShouldNotBeActive($text)
{
assertFalse($this->getCmsTabElement($text)->hasClass('active'));
$element = $this->getCmsTabElement($text);
assertNotNull($element);
assertFalse($element->hasClass('active'));
}
/**