trait FeedsExCommonTrait in Feeds extensible parsers 8
Provides methods useful for Kernel and Functional tests.
This trait is meant to be used only by test classes.
Hierarchy
- trait \Drupal\Tests\feeds_ex\Traits\FeedsExCommonTrait
2 files declare their use of FeedsExCommonTrait
- FeedsExBrowserTestBase.php in tests/
src/ Functional/ FeedsExBrowserTestBase.php - ParserTestBase.php in tests/
src/ FunctionalJavascript/ Feeds/ Parser/ ParserTestBase.php
File
- tests/
src/ Traits/ FeedsExCommonTrait.php, line 10
Namespace
Drupal\Tests\feeds_ex\TraitsView source
trait FeedsExCommonTrait {
/**
* Returns the absolute path to the Drupal root.
*
* @return string
* The absolute path to the directory where Drupal is installed.
*/
protected function absolute() {
return realpath(getcwd());
}
/**
* Returns the absolute directory path of the Feed Extensible parsers module.
*
* @return string
* The absolute path to the Feeds module.
*/
protected function absolutePath() {
return $this
->absolute() . '/' . drupal_get_path('module', 'feeds_ex');
}
/**
* Returns the url to the Feeds Extensible parsers resources directory.
*
* @return string
* The url to the Feeds resources directory.
*/
protected function resourcesUrl() {
return \Drupal::request()
->getSchemeAndHttpHost() . '/' . drupal_get_path('module', 'feeds_ex') . '/tests/resources';
}
/**
* Returns the absolute directory path of the resources folder.
*
* @return string
* The absolute path to the resources folder.
*/
protected function resourcesPath() {
return $this
->absolutePath() . '/tests/resources';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsExCommonTrait:: |
protected | function | Returns the absolute path to the Drupal root. | |
FeedsExCommonTrait:: |
protected | function | Returns the absolute directory path of the Feed Extensible parsers module. | |
FeedsExCommonTrait:: |
protected | function | Returns the absolute directory path of the resources folder. | |
FeedsExCommonTrait:: |
protected | function | Returns the url to the Feeds Extensible parsers resources directory. |