Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
behat_mod_glossary_generator Class Reference
Inheritance diagram for behat_mod_glossary_generator:
behat_generator_base

Public Member Functions

 generate_items (string $generatortype, TableNode $data, bool $singular=false)
 Do the work to generate an entity. More...
 
 process_category (array $data)
 Add a category. More...
 

Protected Member Functions

 get_activity_id (string $idnumber)
 Gets the course cmid for the specified activity based on the activity's idnumber. More...
 
 get_category_id ($idnumber)
 Gets the category id from it's idnumber. More...
 
 get_cm_by_activity_name (string $activity, string $identifier)
 Get a coursemodule from an activity name or idnumber. More...
 
 get_cohort_id ($idnumber)
 Gets the cohort id from it's idnumber. More...
 
 get_contact_id ($username)
 Gets the contact id from it's username. More...
 
 get_context ($levelname, $contextref)
 Gets the internal context id from the context reference. More...
 
 get_course_id ($shortname)
 Gets the course id from it's shortname. More...
 
 get_creatable_entities ()
 Get a list of the entities that Behat can create using the generator step. More...
 
 get_data_generator ()
 Get the module data generator. More...
 
 get_externalbackpack_id ($backpackweburl)
 Gets the external backpack id from it's backpackweburl. More...
 
 get_glossary_id (string $idnumber)
 Get the glossary id using an activity idnumber. More...
 
 get_gradecategory_id ($fullname)
 Gets the grade category id from the grade category fullname. More...
 
 get_group_id ($idnumber)
 Gets the group id from it's idnumber. More...
 
 get_grouping_id ($idnumber)
 Gets the grouping id from it's idnumber. More...
 
 get_outcome_id ($shortname)
 Gets the outcome item id from its shortname. More...
 
 get_questioncategory_id ($name)
 Get the id of a named question category (must be globally unique). More...
 
 get_role_id ($roleshortname)
 Gets the role id from it's shortname. More...
 
 get_scale_id ($name)
 Get the id of a named scale. More...
 
 get_user_id ($username)
 Gets the user id from it's username. More...
 
 name_for_errors (string $entitytype)
 Helper for formatting error messages. More...
 
 preprocess_entry (array $data)
 Preprocess entry data. More...
 

Protected Attributes

string $component
 the name of the component we belong to. More...
 
testing_data_generator $componentdatagenerator
 the data generator for this component.
 
testing_data_generator $datagenerator
 the core data generator
 

Member Function Documentation

◆ generate_items()

behat_generator_base::generate_items ( string  $generatortype,
TableNode  $data,
bool  $singular = false 
)
inherited

Do the work to generate an entity.

This is called by behat_data_generators::the_following_entities_exist().

Parameters
string$generatortypeThe name of the entity to create.
TableNode$datafrom the step.
bool$singularWhether there is only one record and it is pivotted

◆ get_activity_id()

behat_generator_base::get_activity_id ( string  $idnumber)
protectedinherited

Gets the course cmid for the specified activity based on the activity's idnumber.

Note: this does not check the module type, only the idnumber.

Exceptions
Exception
Parameters
string$idnumber
Return values
int

◆ get_category_id()

behat_generator_base::get_category_id (   $idnumber)
protectedinherited

Gets the category id from it's idnumber.

Exceptions
Exception
Parameters
string$idnumber
Return values
int

◆ get_cm_by_activity_name()

behat_generator_base::get_cm_by_activity_name ( string  $activity,
string  $identifier 
)
protectedinherited

Get a coursemodule from an activity name or idnumber.

Parameters
string$activity
string$identifier
Return values
cm_info

◆ get_cohort_id()

behat_generator_base::get_cohort_id (   $idnumber)
protectedinherited

Gets the cohort id from it's idnumber.

Exceptions
Exception
Parameters
string$idnumber
Return values
int

◆ get_contact_id()

behat_generator_base::get_contact_id (   $username)
protectedinherited

Gets the contact id from it's username.

Exceptions
Exception
Parameters
string$username
Return values
int

◆ get_context()

behat_generator_base::get_context (   $levelname,
  $contextref 
)
protectedinherited

Gets the internal context id from the context reference.

The context reference changes depending on the context level, it can be the system, a user, a category, a course or a module.

Exceptions
Exception
Parameters
string$levelnameThe context level string introduced by the test writer
string$contextrefThe context reference introduced by the test writer
Return values
context

◆ get_course_id()

behat_generator_base::get_course_id (   $shortname)
protectedinherited

Gets the course id from it's shortname.

Exceptions
Exception
Parameters
string$shortname
Return values
int

◆ get_creatable_entities()

behat_mod_glossary_generator::get_creatable_entities ( )
protected

Get a list of the entities that Behat can create using the generator step.

Return values
array

Reimplemented from behat_generator_base.

◆ get_data_generator()

behat_mod_glossary_generator::get_data_generator ( )
protected

Get the module data generator.

Return values
mod_glossary_generatorGlossary data generator.

◆ get_externalbackpack_id()

behat_generator_base::get_externalbackpack_id (   $backpackweburl)
protectedinherited

Gets the external backpack id from it's backpackweburl.

Parameters
string$backpackweburl
Return values
mixed
Exceptions
dml_exception

◆ get_glossary_id()

behat_mod_glossary_generator::get_glossary_id ( string  $idnumber)
protected

Get the glossary id using an activity idnumber.

Parameters
string$idnumber
Return values
intThe glossary id

◆ get_gradecategory_id()

behat_generator_base::get_gradecategory_id (   $fullname)
protectedinherited

Gets the grade category id from the grade category fullname.

Parameters
string$fullnamethe grade category name.
Return values
intcorresponding id.

◆ get_group_id()

behat_generator_base::get_group_id (   $idnumber)
protectedinherited

Gets the group id from it's idnumber.

Exceptions
Exception
Parameters
string$idnumber
Return values
int

◆ get_grouping_id()

behat_generator_base::get_grouping_id (   $idnumber)
protectedinherited

Gets the grouping id from it's idnumber.

Exceptions
Exception
Parameters
string$idnumber
Return values
int

◆ get_outcome_id()

behat_generator_base::get_outcome_id (   $shortname)
protectedinherited

Gets the outcome item id from its shortname.

Exceptions
Exception
Parameters
string$shortname
Return values
int

◆ get_questioncategory_id()

behat_generator_base::get_questioncategory_id (   $name)
protectedinherited

Get the id of a named question category (must be globally unique).

Note that 'Top' is a special value, used when setting the parent of another category, meaning top-level.

Parameters
string$namethe question category name.
Return values
intthe question category id.

◆ get_role_id()

behat_generator_base::get_role_id (   $roleshortname)
protectedinherited

Gets the role id from it's shortname.

Exceptions
Exception
Parameters
string$roleshortname
Return values
int

◆ get_scale_id()

behat_generator_base::get_scale_id (   $name)
protectedinherited

Get the id of a named scale.

Parameters
string$namethe name of the scale.
Return values
intthe scale id.

◆ get_user_id()

behat_generator_base::get_user_id (   $username)
protectedinherited

Gets the user id from it's username.

Exceptions
Exception
Parameters
string$username
Return values
int

◆ name_for_errors()

behat_generator_base::name_for_errors ( string  $entitytype)
protectedinherited

Helper for formatting error messages.

Parameters
string$entitytypeentity type without prefix, e.g. 'frog'.
Return values
stringeither 'frog' for core entities, or 'mod_mymod > frog' for components.

◆ preprocess_entry()

behat_mod_glossary_generator::preprocess_entry ( array  $data)
protected

Preprocess entry data.

Parameters
array$dataRaw data.
Return values
arrayProcessed data.

◆ process_category()

behat_mod_glossary_generator::process_category ( array  $data)

Add a category.

Parameters
array$dataCategory data.

Member Data Documentation

◆ $component

string behat_generator_base::$component
protectedinherited

the name of the component we belong to.

This should probably only be used to make error messages clearer.


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