protected function MonitoringUnitTestBase::runSensor in Monitoring 8
Executes a sensor and returns the result.
Parameters
string $sensor_name: Name of the sensor to execute.
Return value
\Drupal\monitoring\Result\SensorResultInterface The sensor result.
26 calls to MonitoringUnitTestBase::runSensor()
- MonitoringApiTest::testAPI in tests/
src/ Kernel/ MonitoringApiTest.php - Test the base class if info is set and passed correctly.
- MonitoringApiTest::testLogging in tests/
src/ Kernel/ MonitoringApiTest.php - Test logging with different settings.
- MonitoringCoreKernelTest::testConfigValueSensorPluginCronSafeThreshold in tests/
src/ Kernel/ MonitoringCoreKernelTest.php - Tests cron safe threshold (poormanscron) sensor.
- MonitoringCoreKernelTest::testConfigValueSensorPluginDefaultTheme in tests/
src/ Kernel/ MonitoringCoreKernelTest.php - Tests the default theme sensor.
- MonitoringCoreKernelTest::testCoreRequirementsSensorPlugin in tests/
src/ Kernel/ MonitoringCoreKernelTest.php - Tests requirements sensors.
File
- tests/
src/ Kernel/ MonitoringUnitTestBase.php, line 40 - Contains \Drupal\monitoring\Tests\MonitoringTestBase.
Class
- MonitoringUnitTestBase
- Base class for all monitoring unit tests.
Namespace
Drupal\Tests\monitoring\KernelCode
protected function runSensor($sensor_name) {
// Make sure the sensor is enabled.
monitoring_sensor_manager()
->enableSensor($sensor_name);
return monitoring_sensor_run($sensor_name, TRUE, TRUE);
}