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.

Tests for behat_form_text class

Copyright: 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
License: https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 191 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

behat_form_text_test:: (4 methods):
  provider_test_set_get_value()
  test_set_get_value()
  provider_test_matches()
  test_matches()

phpunit_string_manager:: (2 methods):
  get_string()
  set_string()


Class: behat_form_text_test  - X-Ref

Tests for the behat_form_text class

provider_test_set_get_value()   X-Ref
Data provider for the test_set_get_value() method.

return: array of value and expectation pairs to be tested.

test_set_get_value($value, $expectation)   X-Ref
Test the set_value() and get_value() methods.

param: mixed $value value to be set.
param: mixed $expectation value to be checked.

provider_test_matches()   X-Ref
Data provider for the test_text_matches() method.

return: array of decsep, value, match and result pairs to be tested.

test_matches($decsep, $value, $match, $result)   X-Ref
Test the matches() method.

param: string $decsep decimal separator to use.
param: mixed $value value to be set.
param: mixed $match value to be matched.
param: bool  $result expected return status of the function.

Class: phpunit_string_manager  - X-Ref

Customised values that will be used instead of standard manager one.

If an existing component/identifier is found, return it instead of the real
one from language files. Note this doesn't support place holders or another niceties.

get_string($identifier, $component = '', $a = null, $lang = null)   X-Ref
Get String returns a requested string

param: string $identifier The identifier of the string to search for
param: string $component The module the string is associated with
param: string|object|array $a An object, string or number that can be used
param: string $lang moodle translation language, null means use current
return: string The String !

set_string($identifier, $component, $value)   X-Ref
Sets a custom string to be returned by the string manager instead of the language file one.

param: string $identifier The identifier of the string to search for
param: string $component The module the string is associated with
param: string $value the contents of the language string to be returned by get_string()