function EnvironmentSupportValidatorTest::testValidUrl

Tests that the validation message links to the provided URL.

File

core/modules/package_manager/tests/src/Kernel/EnvironmentSupportValidatorTest.php, line 65

Class

EnvironmentSupportValidatorTest
@covers \Drupal\package_manager\Validator\EnvironmentSupportValidator[[api-linebreak]] @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testValidUrl() : void {
  $url = 'http://www.example.com';
  putenv(EnvironmentSupportValidator::VARIABLE_NAME . '=' . $url);
  $result = ValidationResult::createError([
    $this->t('<a href=":url">Package Manager is not supported by your environment.</a>', [
      ':url' => $url,
    ]),
  ]);
  $this->assertStatusCheckResults([
    $result,
  ]);
  $this->assertResults([
    $result,
  ], PreCreateEvent::class);
}

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