Merge pull request #56 from halkyon/exception_error

Fixing call to protected method elementNotFound.
This commit is contained in:
Damian Mooyman 2014-06-26 09:19:06 +12:00
commit fd40300c54

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