function LockFileValidatorTest::testApplyWithNoChange

Tests validation when the staged and active lock files are identical.

File

core/modules/package_manager/tests/src/Kernel/LockFileValidatorTest.php, line 179

Class

LockFileValidatorTest
@coversDefaultClass \Drupal\package_manager\Validator\LockFileValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testApplyWithNoChange() : void {
    // Leave the staged lock file alone.
    NoOpStager::setLockFileShouldChange(FALSE);
    $result = ValidationResult::createError([
        t('There appear to be no pending Composer operations because the active lock file (<PROJECT_ROOT>/composer.lock) and the staged lock file (<STAGE_DIR>/composer.lock) are identical.'),
    ], t('Problem detected in lock file during stage operations.'));
    $stage = $this->assertResults([
        $result,
    ], PreApplyEvent::class);
    // A status check shouldn't produce raise any errors, because it's only
    // during pre-apply that we care if there are any pending Composer
    // operations.
    $this->assertStatusCheckResults([], $stage);
}

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