You are here

protected function MonitoringTestBase::runSensor in Monitoring 7

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.

14 calls to MonitoringTestBase::runSensor()
MonitoringApiTest::testAPI in test/tests/monitoring.api.test
Test the base class if info is set and passed correctly.
MonitoringApiTest::testLogging in test/tests/monitoring.api.test
Test logging with different settings.
MonitoringCommerceTest::testOrderStatusSensors in test/tests/monitoring.commerce.test
Test commerce order count sensors with different order status.
MonitoringCommerceTest::testTurnoverSensors in test/tests/monitoring.commerce.test
Test commerce turnover sensors.
MonitoringCoreTest::testGenericDBAggregate in test/tests/monitoring.core.test
Tests the watchdog entries aggregator.

... See full list

File

test/tests/monitoring.base.test, line 51
Contains \MonitoringTestBase.

Class

MonitoringTestBase
Abstract base class for all monitoring tests.

Code

protected function runSensor($sensor_name) {

  // Make sure the sensor is enabled.
  $this->sensorManager
    ->enableSensor($sensor_name);
  return monitoring_sensor_run($sensor_name, TRUE);
}