trait RealisticDummyContentDrupalTrait in Realistic Dummy Content 8.2
Same name and namespace in other branches
- 7.2 api/src/traits/RealisticDummyContentDrupalTrait.php \Drupal\realistic_dummy_content_api\traits\RealisticDummyContentDrupalTrait
- 3.x api/src/traits/RealisticDummyContentDrupalTrait.php \Drupal\realistic_dummy_content_api\traits\RealisticDummyContentDrupalTrait
A trait with wrappers to system calls.
Add this as a trait to any class, which will then be able to use the methods herein, while test classes will be able to mock them.
Hierarchy
- trait \Drupal\realistic_dummy_content_api\traits\RealisticDummyContentDrupalTrait
1 file declares its use of RealisticDummyContentDrupalTrait
File
- api/
src/ traits/ RealisticDummyContentDrupalTrait.php, line 13
Namespace
Drupal\realistic_dummy_content_api\traitsView source
trait RealisticDummyContentDrupalTrait {
/**
* Mockable wrapper around Framework::fieldInfoField().
*/
public function fieldInfoField($field_name) {
return Framework::instance()
->fieldInfoField($field_name);
}
/**
* Mockable wrapper around Framework::getAllVocabularies().
*/
public function getAllVocabularies() {
return Framework::instance()
->getAllVocabularies();
}
/**
* Mockable wrapper around Framework::newVocabularyTerm().
*/
public function newVocabularyTerm($vocabulary, $name) {
return Framework::instance()
->newVocabularyTerm($vocabulary, $name);
}
/**
* Mockable wrapper around Framework::taxonomyLoadTree().
*/
public function taxonomyLoadTree($vid) {
return Framework::instance()
->taxonomyLoadTree($vid);
}
/**
* Mockable wrapper around Framework::termId().
*/
public function termId($term) {
return Framework::instance()
->termId($term);
}
/**
* Mockable wrapper around Framework::termName().
*/
public function termName($term) {
return Framework::instance()
->termName($term);
}
/**
* Mockable wrapper around Framework::vocabularyMachineName().
*/
public function vocabularyMachineName($vocabulary) {
return Framework::instance()
->vocabularyMachineName($vocabulary);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::fieldInfoField(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::getAllVocabularies(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::newVocabularyTerm(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::taxonomyLoadTree(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::termId(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::termName(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::vocabularyMachineName(). |