You are here

protected function SimplenewsMonitoringTest::runSensor in Simplenews 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SimplenewsMonitoringTest.php \Drupal\Tests\simplenews\Kernel\SimplenewsMonitoringTest::runSensor()
  2. 3.x tests/src/Kernel/SimplenewsMonitoringTest.php \Drupal\Tests\simplenews\Kernel\SimplenewsMonitoringTest::runSensor()

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.

1 call to SimplenewsMonitoringTest::runSensor()
SimplenewsMonitoringTest::testSensors in tests/src/Kernel/SimplenewsMonitoringTest.php
Tests individual sensors.

File

tests/src/Kernel/SimplenewsMonitoringTest.php, line 60

Class

SimplenewsMonitoringTest
Tests for simplenews sensor.

Namespace

Drupal\Tests\simplenews\Kernel

Code

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);
}