public function LinkExternalProtocolsConstraintValidatorTest::testValidateIgnoresInternalUrls in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidatorTest::testValidateIgnoresInternalUrls()
@covers ::validate
File
- core/
modules/ link/ tests/ src/ Unit/ Plugin/ Validation/ Constraint/ LinkExternalProtocolsConstraintValidatorTest.php, line 99 - Contains \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidatorTest.
Class
- LinkExternalProtocolsConstraintValidatorTest
- @coversDefaultClass \Drupal\link\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidator @group Link
Namespace
Drupal\Tests\link\Unit\Plugin\Validation\ConstraintCode
public function testValidateIgnoresInternalUrls() {
$link = $this
->getMock('Drupal\\link\\LinkItemInterface');
$link
->expects($this
->any())
->method('getUrl')
->willReturn(Url::fromRoute('example.test'));
$context = $this
->getMock('Symfony\\Component\\Validator\\ExecutionContextInterface');
$context
->expects($this
->never())
->method('addViolation');
$constraint = new LinkExternalProtocolsConstraint();
$validator = new LinkExternalProtocolsConstraintValidator();
$validator
->initialize($context);
$validator
->validate($link, $constraint);
}