Fixing call to protected method elementNotFound.

elementNotFound() is protected, it can't be called from outside.
Throw an ElementNotFoundException instead.
This commit is contained in:
Sean Harvey 2014-06-25 13:47:35 +12:00
parent 3fe596be63
commit 223bb9ec22

View File

@ -459,7 +459,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
// Find field
$field = $page->findField($select);
if (null === $field) {
throw $page->elementNotFound('form field', 'id|name|label|value', $select);
throw new ElementNotFoundException($this->getSession(), 'form field', 'id|name|label|value', $select);
}
// Find option
@ -467,7 +467,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
'option', $this->getSession()->getSelectorsHandler()->xpathLiteral($option)
));
if (null === $opt) {
throw $field->elementNotFound('select option', 'value|text', $option);
throw new ElementNotFoundException($this->getSession(), 'select option', 'value|text', $option);
}
// Merge new option in with old handling both multiselect and single select