Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

File manager form element.

Copyright: 2014 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 122 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/form_field/behat_form_field.php

Defines 1 class

behat_form_filemanager:: (3 methods):
  get_value()
  set_value()
  matches()


Class: behat_form_filemanager  - X-Ref

File manager form field.

Simple filemanager field manager to allow
forms to be filled using TableNodes. It only
adds files and checks the field contents in the
root directory. If you want to run complex actions
that involves subdirectories or other repositories
than 'Upload a file' you should use steps related with
behat_filepicker::i_add_file_from_repository_to_filemanager
this is intended to be used with multi-field

This field manager allows you to:
- Get: A comma-separated list of the root directory
file names, including folders.
- Set: Add a file, in case you want to add more than
one file you can always set two table rows using
the same locator.
- Match: A comma-separated list of file names.

get_value()   X-Ref
Gets the value.

return: string A comma-separated list of the root directory file names.

set_value($value)   X-Ref
Sets the field value.

param: string $value
return: void

matches($expectedvalue)   X-Ref
Matches the provided filename/s against the current field value.

If the filemanager contains more than one file the $expectedvalue
value should include all the file names separating them by comma.

param: string $expectedvalue
return: bool The provided value matches the field value?