function UpdateCalculateProjectDataTest::testProjectStatus

Same name in other branches
  1. 10 core/modules/update/tests/src/Kernel/UpdateCalculateProjectDataTest.php \Drupal\Tests\update\Kernel\UpdateCalculateProjectDataTest::testProjectStatus()

Tests the project_status of the project.

@dataProvider providerProjectStatus

@covers update_calculate_project_update_status

File

core/modules/update/tests/src/Kernel/UpdateCalculateProjectDataTest.php, line 120

Class

UpdateCalculateProjectDataTest
Test the values set in update_calculate_project_data().

Namespace

Drupal\Tests\update\Kernel

Code

public function testProjectStatus(string $fixture, int $status, string $label, string $expected_error_message) : void {
    update_storage_clear();
    $this->setReleaseMetadata(__DIR__ . $fixture);
    $available = update_get_available(TRUE);
    $project_data = update_calculate_project_data($available);
    $this->assertArrayHasKey('status', $project_data['drupal']);
    $this->assertEquals($status, $project_data['drupal']['status']);
    $this->assertArrayHasKey('extra', $project_data['drupal']);
    $this->assertEquals($label, $project_data['drupal']['extra']['0']['label']);
    $this->assertEquals($expected_error_message, $project_data['drupal']['extra']['0']['data']);
}

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