You are here

public function SocialMinkContext::attachFileToHiddenField in Open Social 8.2

Same name and namespace in other branches
  1. 8 tests/behat/features/bootstrap/SocialMinkContext.php \SocialMinkContext::attachFileToHiddenField()

Attaches file to field with specified name.

@When /^(?:|I )attach the file "(?P<path>[^"]*)" to hidden field "(?P<field>(?:[^"]|\\")*)"$/

File

tests/behat/features/bootstrap/SocialMinkContext.php, line 111

Class

SocialMinkContext
Defines application features from the specific context.

Code

public function attachFileToHiddenField($field, $path) {
  $field = $this
    ->fixStepArgument($field);
  $javascript = "jQuery('#" . $field . "').parent().removeClass('hidden')";
  $this
    ->getSession()
    ->executeScript($javascript);
  $this
    ->attachFileToField($field, $path);
}