Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Files interactions with behat. Note that steps definitions files can not extend other steps definitions files, so steps definitions which makes use of file attachments or filepicker should use this behat_file_helper trait.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 271 lines (12 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/behat_base.php

Defines 6 functions


Functions that are not part of a class:

get_filepicker_node($filepickerelement)   X-Ref
Gets the NodeElement for filepicker of filemanager moodleform element.

The filepicker/filemanager element label is pointing to a hidden input which is
not recognized as a named selector, as it is hidden...

param: string $filepickerelement The filepicker form field label
return: NodeElement The hidden element node.

perform_on_element($action, ExpectationException $exception)   X-Ref
Performs $action on a filemanager container element (file or folder).

It works together with open_element_contextual_menu
as this method needs the contextual menu to be opened.

param: string $action
param: ExpectationException $exception
return: void

open_element_contextual_menu($name, $filemanagerelement = false)   X-Ref
Opens the contextual menu of a folder or a file.

Works both in filemanager elements and when dealing with repository
elements inside filepicker modal window.

param: string $name The name of the folder/file
param: string $filemanagerelement The filemanager form element locator, the repository items are in filepicker modal window if false
return: void

open_add_file_window($filemanagernode, $repositoryname)   X-Ref
Opens the filepicker modal window and selects the repository.

param: NodeElement $filemanagernode The filemanager or filepicker form element DOM node.
param: mixed $repositoryname The repo name.
return: void

wait_until_return_to_form()   X-Ref
Waits until the file manager modal windows are closed.

This method is not used by any of our step definitions,
keeping it here for users already using it.

return: void

wait_until_contents_are_updated($filepickernode)   X-Ref
Checks that the file manager contents are not being updated.

This method is not used by any of our step definitions,
keeping it here for users already using it.

param: NodeElement $filepickernode The file manager DOM node
return: void