function ProjectInfoTest::testInstalledVersionSafe

Tests checking if the currently installed version of a project is safe.

@covers ::isInstalledVersionSafe

@dataProvider providerInstalledVersionSafe

Parameters

string $installed_version: The currently installed version of the project.

string $release_xml: The path of the release metadata.

bool $expected_to_be_safe: Whether the installed version of the project is expected to be found safe.

File

core/modules/package_manager/tests/src/Kernel/ProjectInfoTest.php, line 247

Class

ProjectInfoTest
@coversDefaultClass \Drupal\package_manager\ProjectInfo @group auto_updates @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testInstalledVersionSafe(string $installed_version, string $release_xml, bool $expected_to_be_safe) : void {
    $this->setCoreVersion($installed_version);
    $this->setReleaseMetadata([
        'drupal' => $release_xml,
    ]);
    $project_info = new ProjectInfo('drupal');
    $this->assertSame($expected_to_be_safe, $project_info->isInstalledVersionSafe());
}

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