Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
nasty_strings Class Reference

Nasty strings manager. More...

Static Public Member Functions

static get ($key)
 Returns a nasty string and stores the key mapping.
 
static reset_used_strings ()
 Resets the used strings var.
 

Static Protected Member Functions

static random_index ()
 Returns a random index.
 

Static Protected Attributes

static array $strings
 List of different strings to fill fields and assert against them.
 
static array $usedstrings = array()
 Already used nasty strings.
 

Detailed Description

Nasty strings manager.

Responds to nasty strings requests with a random string of the list to try with different combinations in different places.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get()

static nasty_strings::get ( $key)
static

Returns a nasty string and stores the key mapping.

Parameters
string$keyThe key
Return values
string

◆ random_index()

static nasty_strings::random_index ( )
staticprotected

Returns a random index.

Return values
int

◆ reset_used_strings()

static nasty_strings::reset_used_strings ( )
static

Resets the used strings var.

Return values
void

Member Data Documentation

◆ $strings

array nasty_strings::$strings
staticprotected
Initial value:
= array(
'< > & &lt; &gt; &amp; ' \" '$@NULL@$ @@TEST@@ \\" \ , ; : . 日本語­% %%',
'&amp; ' \" '$@NULL@$ < > & &lt; &gt; @@TEST@@ \\" \ , ; : . 日本語­% %%',
'< > & &lt; &gt; &amp; ' \" \\" \ , ; : . \'$@NULL@$ @@TEST@@ 日本語­% %%',
'< > & &lt; &gt; &amp; ' \" '$@NULL@$ 日本語­% %%@@TEST@@ . \\" \ , ; :',
'< > & &lt; &gt; \\" \ , ; : . 日本語&amp; ' \" '$@NULL@$ @@TEST@@­% %%',
'\' \" '$@NULL@$ @@TEST@@ < > & &lt; &gt; &amp; \\" \ , ; : . 日本語­% %%',
'\\\" \ , ; : . 日本語­% < > & &lt; &gt; &amp; ' \" '$@NULL@$ @@TEST@@ %%',
'< > & &lt; &gt; &amp; ' \" '$@NULL@$ 日本語­% %% @@TEST@@ \\" \ . , ; :',
'. 日本語&amp; ' \" < > & &lt; &gt; \ , ; : '$@NULL@$ \\" @@TEST@@­% %%',
'&amp; ' \" < > & &lt; &gt; \\" \ , ; : . 日本語\'$@NULL@$ @@TEST@@­% %%',
)

List of different strings to fill fields and assert against them.

Non of these strings can be a part of another one, this would not be good when using more one string at the same time and asserting results.

◆ $usedstrings

array nasty_strings::$usedstrings = array()
staticprotected

Already used nasty strings.

This array will be cleaned before each scenario.


The documentation for this class was generated from the following file: