You are here

public function ServiceTest::testIsSystemShowingSmoke in Purge 8.3

Tests DiagnosticsService::isSystemShowingSmoke.

File

tests/src/Kernel/DiagnosticCheck/ServiceTest.php, line 215

Class

ServiceTest
Tests DiagnosticsService.

Namespace

Drupal\Tests\purge\Kernel\DiagnosticCheck

Code

public function testIsSystemShowingSmoke() : void {
  $this
    ->assertTrue($this->service
    ->isSystemShowingSmoke() instanceof DiagnosticCheckInterface);
  $warning_plugin_id = $this->service
    ->isSystemShowingSmoke()
    ->getPluginId();
  $possibilities = [
    'alwayswarning',
    'capacity',
    'queuersavailable',
    'memoryqueuewarning',
    'page_cache',
  ];
  $warning_known = in_array($warning_plugin_id, $possibilities);
  $this
    ->assertTrue($warning_known, "Can't find '{$warning_plugin_id}'.");
}