mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 15:05:32 +00:00
FIX: Invalid Exception throw results in CI failures
This commit is contained in:
parent
7b85ffdcde
commit
1a1d5bdead
@ -605,13 +605,25 @@ JS;
|
|||||||
|
|
||||||
if(trim($negate)) {
|
if(trim($negate)) {
|
||||||
if (preg_match($regex, $actual)) {
|
if (preg_match($regex, $actual)) {
|
||||||
$message = sprintf('The text "%s" was found in the text of the "%s" region.', $text, $region);
|
$message = sprintf(
|
||||||
throw new \Exception($message, $this->getSession());
|
'The text "%s" was found in the text of the "%s" region on the page %s.',
|
||||||
|
$text,
|
||||||
|
$region,
|
||||||
|
$this->getSession()->getCurrentUrl()
|
||||||
|
);
|
||||||
|
|
||||||
|
throw new \Exception($message);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!preg_match($regex, $actual)) {
|
if (!preg_match($regex, $actual)) {
|
||||||
$message = sprintf('The text "%s" was not found anywhere in the text of the "%s" region.', $text, $region);
|
$message = sprintf(
|
||||||
throw new \Exception($message, $this->getSession());
|
'The text "%s" was not found anywhere in the text of the "%s" region on the page %s.',
|
||||||
|
$text,
|
||||||
|
$region,
|
||||||
|
$this->getSession()->getCurrentUrl()
|
||||||
|
);
|
||||||
|
|
||||||
|
throw new \Exception($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user