class LiveEnvironment in Realistic Dummy Content 8
The live environment.
During normal execution, we want to do things like interact with the file- system and such. However during testing we want to abstract that away. This class represents the live environment.
Hierarchy
- class \Drupal\realistic_dummy_content_api\environments\Environment
- class \Drupal\realistic_dummy_content_api\environments\LiveEnvironment
Expanded class hierarchy of LiveEnvironment
1 file declares its use of LiveEnvironment
- Environment.php in api/
src/ environments/ Environment.php - Define autoload class.
File
- api/
src/ environments/ LiveEnvironment.php, line 20 - Define autoload class.
Namespace
Drupal\realistic_dummy_content_api\environmentsView source
class LiveEnvironment extends Environment {
/**
* {@inheritdoc}
*/
function _file_get_contents_($filename) {
return file_get_contents($filename);
}
function _file_save_data_($data, $destination = NULL) {
return file_save_data($data, $destination);
}
function _file_save_(stdClass $file) {
return file_save($file);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Environment:: |
private static | property | ||
Environment:: |
static | function | ||
Environment:: |
static | function | Returns the attribute of a filename if one exists | |
Environment:: |
static | function | Wrapper around drupal_get_path(). | |
Environment:: |
static | function | Returns the name radical of a filename. | |
Environment:: |
function | Get the contents of a file. | ||
Environment:: |
function | |||
Environment:: |
function | Save the file data to the real or test environment. | ||
Environment:: |
static | function | Get the current environment. | |
Environment:: |
static | function | Returns all files with a given extension for a given filepath. | |
Environment:: |
static | function | Returns the trimmed contents of a Drpual file object, or NULL if empty. | |
Environment:: |
static | function | ||
Environment:: |
static | function | Returns the part of a string before the extension, in lowercase | |
Environment:: |
static | function | Returns part of a filename | |
Environment:: |
static | function | Set the current environment | |
Environment:: |
static | function | Given a list of candidate files, sort them by names and parts. | |
Environment:: |
static | function | Given a list of candidate files, sort them by names and parts. | |
Environment:: |
static | function | ||
LiveEnvironment:: |
function |
Internal function used to get the contents of a file. Overrides Environment:: |
||
LiveEnvironment:: |
function |
Overrides Environment:: |
||
LiveEnvironment:: |
function |
Overrides Environment:: |