Loading core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php +7 −11 Original line number Diff line number Diff line Loading @@ -18,8 +18,13 @@ class LinkExternalProtocolsConstraintValidatorTest extends UnitTestCase { /** * @covers ::validate * @dataProvider providerValidate * @runInSeparateProcess */ public function testValidate($value, $valid) { public function testValidate($url, $valid) { $link = $this->createMock('Drupal\link\LinkItemInterface'); $link->expects($this->any()) ->method('getUrl') ->willReturn(Url::fromUri($url)); $context = $this->createMock(ExecutionContextInterface::class); if ($valid) { Loading @@ -38,7 +43,7 @@ public function testValidate($value, $valid) { $validator = new LinkExternalProtocolsConstraintValidator(); $validator->initialize($context); $validator->validate($value, $constraint); $validator->validate($link, $constraint); } /** Loading @@ -56,15 +61,6 @@ public function providerValidate() { // Invalid protocols. $data[] = ['ftp://ftp.funet.fi/pub/standards/RFC/rfc959.txt', FALSE]; foreach ($data as &$single_data) { $url = Url::fromUri($single_data[0]); $link = $this->createMock('Drupal\link\LinkItemInterface'); $link->expects($this->any()) ->method('getUrl') ->willReturn($url); $single_data[0] = $link; } return $data; } Loading core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,8 @@ public static function providerTestIsExternal() { * Expected escaped value. * @param array $protocols * Protocols to allow. * * @runInSeparateProcess */ public function testFilterBadProtocol($uri, $expected, $protocols) { UrlHelper::setAllowedProtocols($protocols); Loading Loading @@ -488,6 +490,8 @@ public static function providerTestFilterBadProtocol() { * Expected escaped value. * @param array $protocols * Protocols to allow. * * @runInSeparateProcess */ public function testStripDangerousProtocols($uri, $expected, $protocols) { UrlHelper::setAllowedProtocols($protocols); Loading core/tests/Drupal/Tests/Component/Utility/XssTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ * Relevant CVEs: * - CVE-2002-1806, ~CVE-2005-0682, ~CVE-2005-2106, CVE-2005-3973, * CVE-2006-1226 (= rev. 1.112?), CVE-2008-0273, CVE-2008-3740. * * @runTestsInSeparateProcesses */ class XssTest extends TestCase { Loading Loading
core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php +7 −11 Original line number Diff line number Diff line Loading @@ -18,8 +18,13 @@ class LinkExternalProtocolsConstraintValidatorTest extends UnitTestCase { /** * @covers ::validate * @dataProvider providerValidate * @runInSeparateProcess */ public function testValidate($value, $valid) { public function testValidate($url, $valid) { $link = $this->createMock('Drupal\link\LinkItemInterface'); $link->expects($this->any()) ->method('getUrl') ->willReturn(Url::fromUri($url)); $context = $this->createMock(ExecutionContextInterface::class); if ($valid) { Loading @@ -38,7 +43,7 @@ public function testValidate($value, $valid) { $validator = new LinkExternalProtocolsConstraintValidator(); $validator->initialize($context); $validator->validate($value, $constraint); $validator->validate($link, $constraint); } /** Loading @@ -56,15 +61,6 @@ public function providerValidate() { // Invalid protocols. $data[] = ['ftp://ftp.funet.fi/pub/standards/RFC/rfc959.txt', FALSE]; foreach ($data as &$single_data) { $url = Url::fromUri($single_data[0]); $link = $this->createMock('Drupal\link\LinkItemInterface'); $link->expects($this->any()) ->method('getUrl') ->willReturn($url); $single_data[0] = $link; } return $data; } Loading
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,8 @@ public static function providerTestIsExternal() { * Expected escaped value. * @param array $protocols * Protocols to allow. * * @runInSeparateProcess */ public function testFilterBadProtocol($uri, $expected, $protocols) { UrlHelper::setAllowedProtocols($protocols); Loading Loading @@ -488,6 +490,8 @@ public static function providerTestFilterBadProtocol() { * Expected escaped value. * @param array $protocols * Protocols to allow. * * @runInSeparateProcess */ public function testStripDangerousProtocols($uri, $expected, $protocols) { UrlHelper::setAllowedProtocols($protocols); Loading
core/tests/Drupal/Tests/Component/Utility/XssTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ * Relevant CVEs: * - CVE-2002-1806, ~CVE-2005-0682, ~CVE-2005-2106, CVE-2005-3973, * CVE-2006-1226 (= rev. 1.112?), CVE-2008-0273, CVE-2008-3740. * * @runTestsInSeparateProcesses */ class XssTest extends TestCase { Loading