mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
FIX logic error where a variable is used for two purposes
The issue that prompted this change was that at line 361, if an exception needed to be thrown, it would be thrown with $field being a NodeElement rather than a string, causing a Catchable Fatal Error to be thrown in ElementNotFoundException::__construct#46 (can't convert object of type NodeElement to string).
This commit is contained in:
parent
7f370df19b
commit
2ff6ddeaaa
@ -351,9 +351,9 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
|
||||
$fields = $this->getSession()->getPage()->findAll('named', array(
|
||||
'field', $this->getSession()->getSelectorsHandler()->xpathLiteral($field)
|
||||
));
|
||||
if($fields) foreach($fields as $field) {
|
||||
if($field->isVisible()) {
|
||||
$field->setValue($value);
|
||||
if($fields) foreach($fields as $f) {
|
||||
if($f->isVisible()) {
|
||||
$f->setValue($value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user