Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

Behat arguments transformations. This methods are used by Behat CLI command.

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

Defines 1 class


Class: behat_transformations  - X-Ref

Transformations to apply to steps arguments.

This methods are applied to the steps arguments that matches
the regular expressions specified in the @Transform tag.

prefixed_tablenode_transformations()   X-Ref


arg_replace_slashes($string)   X-Ref
Removes escaped argument delimiters.

We use double quotes as arguments delimiters and
to add the " as part of an argument we escape it
with a backslash, this method removes this backslash.

param: string $string
return: string The string with the arguments fixed.

arg_replace_nasty_strings($argument)   X-Ref
Replaces $NASTYSTRING vars for a nasty string.

param: string $argument The whole argument value.
return: string

arg_time_to_string($time)   X-Ref
Convert string time to timestamp.
Use ::time::STRING_TIME_TO_CONVERT::DATE_FORMAT::

param: string $time
return: int timestamp.

tablenode_transformations(TableNode $tablenode)   X-Ref
Transformations for TableNode arguments.

Transformations applicable to TableNode arguments should also
be applied, adding them in a different method for Behat API restrictions.

param: TableNode $tablenode
return: TableNode The transformed table

arg_insert_wwwroot(string $string)   X-Ref
Convert #wwwroot# to the wwwroot config value, so it is
possible to reference fully qualified URLs within the site.

param: string $string
return: string

replace_nasty_strings($string)   X-Ref
Replaces $NASTYSTRING vars for a nasty string.

Method reused by TableNode tranformation.

param: string $string
return: string

get_transformed_timestamp($time)   X-Ref
No description

replace_wwwroot(string $string)   X-Ref
Replace #wwwroot# with the actual wwwroot config value.

param: string $string String to attempt the replacement in.
return: string