function 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 <a href="/api/drupal/core%21modules%21update%21update.compare.inc/function/update_calculate_project_data/11.x" title="Calculates the current update status of all projects on the site." class="local">update_calculate_project_data</a>().

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.