function UpdateReportTest::testTemplatePreprocessUpdateReport

Same name and namespace in other branches
  1. 9 core/modules/update/tests/src/Kernel/UpdateReportTest.php \Drupal\Tests\update\Kernel\UpdateReportTest::testTemplatePreprocessUpdateReport()
  2. 10 core/modules/update/tests/src/Kernel/UpdateReportTest.php \Drupal\Tests\update\Kernel\UpdateReportTest::testTemplatePreprocessUpdateReport()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.