function PackageManagerKernelTestBase::assertExpectedResultsFromException

Asserts that a StageEventException has a particular set of results.

Parameters

array $expected_results: The expected results.

\Drupal\package_manager\Exception\StageEventException $exception: The exception.

3 calls to PackageManagerKernelTestBase::assertExpectedResultsFromException()
PackageManagerKernelTestBase::assertResults in core/modules/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php
Asserts validation results are returned from a stage life cycle event.
PendingUpdatesValidatorTest::testPendingUpdateAfterStaged in core/modules/package_manager/tests/src/Kernel/PendingUpdatesValidatorTest.php
Tests that pending updates stop an operation from being applied.
SymlinkValidatorTest::testSymlinkPointingOutsideStageDirectory in core/modules/package_manager/tests/src/Kernel/SymlinkValidatorTest.php
Tests that relative symlinks cannot point outside the stage directory.

File

core/modules/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php, line 442

Class

PackageManagerKernelTestBase
Base class for kernel tests of Package Manager's functionality.

Namespace

Drupal\Tests\package_manager\Kernel

Code

protected function assertExpectedResultsFromException(array $expected_results, StageEventException $exception) : void {
    $event = $exception->event;
    $this->assertInstanceOf(PreOperationStageEvent::class, $event);
    $stage = $event->stage;
    $stage_dir = $stage->stageDirectoryExists() ? $stage->getStageDirectory() : NULL;
    $this->assertValidationResultsEqual($expected_results, $event->getResults(), NULL, $stage_dir);
}

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