You are here

public function UpdateReportTest::testTemplatePreprocessUpdateReport in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/update/tests/src/Kernel/UpdateReportTest.php \Drupal\Tests\update\Kernel\UpdateReportTest::testTemplatePreprocessUpdateReport()

@dataProvider providerTemplatePreprocessUpdateReport

File

core/modules/update/tests/src/Kernel/UpdateReportTest.php, line 26

Class

UpdateReportTest
Tests update report functionality.

Namespace

Drupal\Tests\update\Kernel

Code

public function testTemplatePreprocessUpdateReport($variables) {
  \Drupal::moduleHandler()
    ->loadInclude('update', 'inc', 'update.report');

  // The function should run without an exception being thrown when the value
  // of $variables['data'] is not set or is not an array.
  template_preprocess_update_report($variables);

  // Test that the key "no_updates_message" has been set.
  $this
    ->assertArrayHasKey('no_updates_message', $variables);
}