function LinkNotExistingInternalConstraintValidatorTest::testValidateFromUri

Same name in other branches
  1. 11.x core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkNotExistingInternalConstraintValidatorTest::testValidateFromUri()

@covers ::validate

File

core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php, line 26

Class

LinkNotExistingInternalConstraintValidatorTest
@coversDefaultClass \Drupal\link\Plugin\Validation\Constraint\LinkNotExistingInternalConstraintValidator @group Link

Namespace

Drupal\Tests\link\Unit\Plugin\Validation\Constraint

Code

public function testValidateFromUri() : void {
    $url = Url::fromUri('https://www.drupal.org');
    $link = $this->createMock(LinkItemInterface::class);
    $link->expects($this->any())
        ->method('getUrl')
        ->willReturn($url);
    $context = $this->createMock(ExecutionContextInterface::class);
    $context->expects($this->never())
        ->method('addViolation');
    $this->validate($link, $context);
}

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