function TemplateProjectTestBase::assertAppliedChangesWereLogged

Asserts that changes applied during the stage life cycle were logged.

This method specifically asserts changes that were *applied*, rather than the changes that were merely requested. For example, if a package was required into the stage and it added a secondary dependency, that change will be considered one of the applied changes, not a requested change.

Parameters

string[] $expected_applied_changes: The expected applied changes.

See also

::assertRequestedChangesWereLogged()

\Drupal\package_manager\EventSubscriber\ChangeLogger

File

core/modules/package_manager/tests/src/Build/TemplateProjectTestBase.php, line 689

Class

TemplateProjectTestBase
Base class for tests which create a test site from a core project template.

Namespace

Drupal\Tests\package_manager\Build

Code

protected function assertAppliedChangesWereLogged(array $expected_applied_changes) : void {
    $this->visitPackageManagerChangeLog();
    $assert_session = $this->getMink()
        ->assertSession();
    $assert_session->elementExists('css', 'a[href*="/admin/reports/dblog/event/"]:contains("Applied changes:")')
        ->click();
    array_walk($expected_applied_changes, $assert_session->pageTextContains(...));
}

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