Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is 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?