function UpdateReportTest::testTemplatePreprocessUpdateReport

Same name in other branches
  1. 9 core/modules/update/tests/src/Kernel/UpdateReportTest.php \Drupal\Tests\update\Kernel\UpdateReportTest::testTemplatePreprocessUpdateReport()
  2. 8.9.x 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 33

Class

UpdateReportTest
Tests update report functionality.

Namespace

Drupal\Tests\update\Kernel

Code

public function testTemplatePreprocessUpdateReport($variables) : void {
    \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.