Differences Between: [Versions 311 and 402] [Versions 311 and 403]
Block generator base class.
Copyright: | 2012 Petr Skoda {@link http://skodak.org} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 165 lines (6 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
testing_block_generator:: (2 methods):
reset()
get_blockname()
name:: (3 methods):
prepare_record()
create_instance()
preprocess_record()
name:: (3 methods):
prepare_record()
create_instance()
preprocess_record()
Class: testing_block_generator - X-Ref
Block generator base class.reset() X-Ref |
To be called from data reset code only, do not use in tests. return: void |
get_blockname() X-Ref |
Returns block name return: string name of block that this class describes |
prepare_record(stdClass $record) X-Ref |
Fill in record defaults. param: stdClass $record return: stdClass |
create_instance($record = null, $options = array() X-Ref |
Create a test block instance. The $record passed in becomes the basis for the new row added to the block_instances table. You only need to supply the values of interest. Any missing values have sensible defaults filled in. The $options array provides additional data, not directly related to what will be inserted in the block_instance table, which may affect the block that is created. The meanings of any data passed here depends on the particular type of block being created. param: array|stdClass $record forms the basis for the entry to be inserted in the block_instances table. param: array $options further, block-specific options to control how the block is created. return: stdClass the block_instance record that has just been created. |
preprocess_record(stdClass $record, array $options) X-Ref |
Can be overridden to do block-specific processing. $record can be modified in-place. param: stdClass $record the data, before defaults are filled in. param: array $options further, block-specific options, as passed to {@link create_instance()}. |
prepare_record(stdClass $record) X-Ref |
Fill in record defaults. param: stdClass $record return: stdClass |
create_instance($record = null, $options = array() X-Ref |
Create a test block instance. The $record passed in becomes the basis for the new row added to the block_instances table. You only need to supply the values of interest. Any missing values have sensible defaults filled in. The $options array provides additional data, not directly related to what will be inserted in the block_instance table, which may affect the block that is created. The meanings of any data passed here depends on the particular type of block being created. param: array|stdClass $record forms the basis for the entry to be inserted in the block_instances table. param: array $options further, block-specific options to control how the block is created. return: stdClass the block_instance record that has just been created. |
preprocess_record(stdClass $record, array $options) X-Ref |
Can be overridden to do block-specific processing. $record can be modified in-place. param: stdClass $record the data, before defaults are filled in. param: array $options further, block-specific options, as passed to {@link create_instance()}. |