-
Bug
-
Resolution: Fixed
-
Major
-
2.7.6, 2.8.4
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
There is lots of code like
try { |
$this->row_column_of_table_should_contain($row, $column, $table, $value); |
// Throw exception if found. |
throw new ExpectationException( |
'"' . $column . '" with value "' . $value . '" is present in "' . $row . '" row for table "' . $table . '"', |
$this->getSession() |
);
|
} catch (ElementNotFoundException $e) { |
// Table row/column doesn't contain this value. Nothing to do. |
return; |
}
|
This does not work as intended, because the thrown exceptoin is immediately caught again.
Actually, that one is OK, since the two exceptoin types are different, but other ones were wrong, and the pattern is dangerous, in case anyone changes the exception types in future. I will fix them all, even the ones that are not broken.