diff --git a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php index e69ba71..48b1c07 100644 --- a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php +++ b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\action\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests action local tasks. * * @group action */ -class ActionLocalTasksTest extends LocalTaskIntegrationTest { +class ActionLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('action' => 'core/modules/action'); diff --git a/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php b/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php index 80a2db5..f2dd7b4 100644 --- a/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php +++ b/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\aggregator\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of aggregator local tasks. * * @group aggregator */ -class AggregatorLocalTasksTest extends LocalTaskIntegrationTest { +class AggregatorLocalTasksTest extends LocalTaskIntegrationTestBase { /** * {@inheritdoc} diff --git a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php index fcfeec8..f70a57c 100644 --- a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php +++ b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php @@ -7,7 +7,7 @@ namespace Drupal\Tests\block\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; use Symfony\Component\DependencyInjection\ContainerBuilder; /** @@ -15,7 +15,7 @@ * * @group block */ -class BlockLocalTasksTest extends LocalTaskIntegrationTest { +class BlockLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('block' => 'core/modules/block'); diff --git a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php index f3eb8be..d17fc3b 100644 --- a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php +++ b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php @@ -8,14 +8,14 @@ namespace Drupal\block_content\Tests; use Drupal\Component\Utility\Unicode; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; /** * Tests the block content translation UI. * * @group block_content */ -class BlockContentTranslationUITest extends ContentTranslationUITest { +class BlockContentTranslationUITest extends ContentTranslationUITestBase { /** * Modules to enable. @@ -54,7 +54,7 @@ protected function setupBundle() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ public function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array( @@ -91,7 +91,7 @@ protected function createBlockContent($title = FALSE, $bundle = FALSE) { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues(). */ protected function getNewEntityValues($langcode) { return array('info' => Unicode::strtolower($this->randomMachineName())) + parent::getNewEntityValues($langcode); diff --git a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php index 83cbcf8..9c01796 100644 --- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php +++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php @@ -7,7 +7,7 @@ namespace Drupal\Tests\block_content\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; use Symfony\Component\DependencyInjection\ContainerBuilder; /** @@ -15,7 +15,7 @@ * * @group block_content */ -class BlockContentLocalTasksTest extends LocalTaskIntegrationTest { +class BlockContentLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array( diff --git a/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php b/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php index 1702855..d45929b 100644 --- a/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php +++ b/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\book\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of book local tasks. * * @group book */ -class BookLocalTasksTest extends LocalTaskIntegrationTest { +class BookLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array( diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/src/Tests/CommentTranslationUITest.php index da0ab2c..fdd69db 100644 --- a/core/modules/comment/src/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php @@ -8,7 +8,7 @@ namespace Drupal\comment\Tests; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; use Drupal\language\Entity\ConfigurableLanguage; /** @@ -16,7 +16,7 @@ * * @group comment */ -class CommentTranslationUITest extends ContentTranslationUITest { +class CommentTranslationUITest extends ContentTranslationUITestBase { use CommentTestTrait; @@ -49,7 +49,7 @@ protected function setUp() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupBundle(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::setupBundle(). */ function setupBundle() { parent::setupBundle(); @@ -66,14 +66,14 @@ function setupBundle() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array('post comments', 'administer comments', 'access comments')); } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::createEntity(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::createEntity(). */ protected function createEntity($values, $langcode, $comment_type = 'comment_article') { if ($comment_type == 'comment_article') { @@ -100,7 +100,7 @@ protected function createEntity($values, $langcode, $comment_type = 'comment_art } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues(). */ protected function getNewEntityValues($langcode) { // Comment subject is not translatable hence we use a fixed value. diff --git a/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php b/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php index a757378..1da4148 100644 --- a/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php +++ b/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\config\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of config local tasks. * * @group config */ -class ConfigLocalTasksTest extends LocalTaskIntegrationTest { +class ConfigLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('config' => 'core/modules/config'); diff --git a/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php b/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php index 2b4e3cc..097ff0e 100644 --- a/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php +++ b/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php @@ -12,7 +12,7 @@ * * @group content_translation */ -class ContentTestTranslationUITest extends ContentTranslationUITest { +class ContentTestTranslationUITest extends ContentTranslationUITestBase { /** * Modules to enable. @@ -31,7 +31,7 @@ protected function setUp() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array('administer entity_test content')); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php similarity index 99% rename from core/modules/content_translation/src/Tests/ContentTranslationUITest.php rename to core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php index 8d12742..3c1bd78 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\content_translation\Tests\ContentTranslationUITest. + * Contains \Drupal\content_translation\Tests\ContentTranslationUITestBase. */ namespace Drupal\content_translation\Tests; @@ -16,7 +16,7 @@ /** * Tests the Content Translation UI. */ -abstract class ContentTranslationUITest extends ContentTranslationTestBase { +abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { /** * The id of the entity being translated. diff --git a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php index 1a58b31..9153446 100644 --- a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php +++ b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\content_translation\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests content translation local tasks. * * @group content_translation */ -class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTest { +class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array( diff --git a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php index 6e35abb..572e328 100644 --- a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php +++ b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\language\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of language local tasks. * * @group language */ -class LanguageLocalTasksTest extends LocalTaskIntegrationTest { +class LanguageLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array( diff --git a/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php b/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php index e30f676..1c3d748 100644 --- a/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php +++ b/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\locale\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests locale local tasks. * * @group locale */ -class LocaleLocalTasksTest extends LocalTaskIntegrationTest { +class LocaleLocalTasksTest extends LocalTaskIntegrationTestBase { /** * {@inheritdoc} diff --git a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php index ab4c62a..a3859ca 100644 --- a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php +++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php @@ -7,7 +7,7 @@ namespace Drupal\menu_link_content\Tests; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; use Drupal\menu_link_content\Entity\MenuLinkContent; /** @@ -15,7 +15,7 @@ * * @group Menu */ -class MenuLinkContentUITest extends ContentTranslationUITest { +class MenuLinkContentUITest extends ContentTranslationUITestBase { /** * Modules to enable. diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index 80a9d1e..55214c2 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -8,7 +8,7 @@ namespace Drupal\node\Tests; use Drupal\Core\Entity\EntityInterface; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Url; use Drupal\node\Entity\Node; @@ -18,7 +18,7 @@ * * @group node */ -class NodeTranslationUITest extends ContentTranslationUITest { +class NodeTranslationUITest extends ContentTranslationUITestBase { /** * Modules to enable. @@ -58,7 +58,7 @@ function testTranslationUI() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array('administer nodes', "edit any $this->bundle content")); @@ -79,7 +79,7 @@ protected function getAdministratorPermissions() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues(). */ protected function getNewEntityValues($langcode) { return array('title' => array(array('value' => $this->randomMachineName()))) + parent::getNewEntityValues($langcode); @@ -98,7 +98,7 @@ protected function getFormSubmitAction(EntityInterface $entity, $langcode) { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::assertPublishedStatus(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::assertPublishedStatus(). */ protected function doTestPublishedStatus() { $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); @@ -129,7 +129,7 @@ protected function doTestPublishedStatus() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::assertAuthoringInfo(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::assertAuthoringInfo(). */ protected function doTestAuthoringInfo() { $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); diff --git a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php index 81b67d3..083422f 100644 --- a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php +++ b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php @@ -7,7 +7,7 @@ namespace Drupal\shortcut\Tests; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; use Drupal\Core\Entity\EntityChangedInterface; use Drupal\Core\Language\Language; @@ -16,7 +16,7 @@ * * @group Shortcut */ -class ShortcutTranslationUITest extends ContentTranslationUITest { +class ShortcutTranslationUITest extends ContentTranslationUITestBase { /** * Modules to enable. diff --git a/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php b/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php index 526b680..b3d3ed9 100644 --- a/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php +++ b/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\shortcut\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of shortcut local tasks. * * @group shortcut */ -class ShortcutLocalTasksTest extends LocalTaskIntegrationTest { +class ShortcutLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array( diff --git a/core/modules/simpletest/src/TestDiscovery.php b/core/modules/simpletest/src/TestDiscovery.php index 4c762a7..6a9407e 100644 --- a/core/modules/simpletest/src/TestDiscovery.php +++ b/core/modules/simpletest/src/TestDiscovery.php @@ -160,9 +160,13 @@ public function getTestClasses($extension = NULL) { try { $info = static::getTestInfo($classname, $parser->getDocComment()); } - catch (\LogicException $e) { - // If the class is missing a summary line or an @group annotation just - // skip it. Most likely it is an abstract class, trait or test fixture. + catch (MissingGroupException $e) { + // If the class name ends in Test and is not a migrate table dump. + if (preg_match('/Test$/', $classname) && strpos($classname, 'migrate_drupal\Tests\Table') === FALSE) { + throw $e; + } + // If the class is @group annotation just skip it. Most likely it is an + // abstract class, trait or test fixture. continue; } // Skip this test class if it requires unavailable modules. diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php b/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php index 2c15bed..c46eb9c 100644 --- a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php +++ b/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php @@ -9,12 +9,15 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\GeneratedUrl; use Drupal\simpletest\KernelTestBase; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; /** + * Tests the route processor. + * * @see system.routing.yml * @see \Drupal\Core\Routing\UrlGenerator * @group route_processor @@ -67,8 +70,10 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); - $this->assertEqual(['#test-fragment', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl(''); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('#test-fragment'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); // Test request with subdir on other page. $server = [ @@ -82,8 +87,10 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); - $this->assertEqual(['#test-fragment', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl(''); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('#test-fragment'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); // Test request without subdir on the homepage. $server = [ @@ -97,8 +104,10 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); - $this->assertEqual(['#test-fragment', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl(''); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('#test-fragment'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); // Test request without subdir on other page. $server = [ @@ -112,8 +121,10 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); - $this->assertEqual(['#test-fragment', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl(''); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE, TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('#test-fragment'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], ['fragment' => 'test-fragment'], TRUE)); } } diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php index 8e8a357..4297ed1 100644 --- a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php +++ b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php @@ -9,12 +9,15 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\GeneratedUrl; use Drupal\simpletest\KernelTestBase; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; /** + * Tests the route processor. + * * @see \Drupal\Core\RouteProcessor\RouteProcessorCurrent * @group route_processor */ @@ -68,7 +71,8 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['/subdir/', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('/subdir/'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE)); // Test request with subdir on other page. $server = [ @@ -82,7 +86,8 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['/subdir/node/add', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('/subdir/node/add'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE)); // Test request without subdir on the homepage. $server = [ @@ -96,7 +101,8 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['/', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('/'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE)); // Test request without subdir on other page. $server = [ @@ -110,7 +116,8 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); - $this->assertEqual(['/node/add', $expected_cacheability], $this->urlGenerator->generateFromRoute('', [], [], TRUE)); + $url = GeneratedUrl::createFromObject($expected_cacheability)->setGeneratedUrl('/node/add'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE)); // Test request without a found route. This happens for example on an // not found exception page. @@ -126,7 +133,8 @@ public function testProcessOutbound() { // In case we have no routing, the current route should point to the front, // and the cacheability does not depend on the 'route' cache context, since // no route was involved at all: this is fallback behavior. - $this->assertEqual(['/', (new CacheableMetadata())->setCacheMaxAge(Cache::PERMANENT)], $this->urlGenerator->generateFromRoute('', [], [], TRUE)); + $url = GeneratedUrl::createFromObject((new CacheableMetadata())->setCacheMaxAge(Cache::PERMANENT))->setGeneratedUrl('/'); + $this->assertEqual($url, $this->urlGenerator->generateFromRoute('', [], [], TRUE)); } } diff --git a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php index e1b48e9..802f5ef 100644 --- a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php +++ b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php @@ -8,14 +8,14 @@ namespace Drupal\Tests\system\Unit\Menu; use Drupal\Core\Extension\Extension; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of system local tasks. * * @group system */ -class SystemLocalTasksTest extends LocalTaskIntegrationTest { +class SystemLocalTasksTest extends LocalTaskIntegrationTestBase { /** * The mocked theme handler. diff --git a/core/modules/system/tests/src/Unit/SystemRequirementsTest.php b/core/modules/system/tests/src/Unit/SystemRequirementsTest.php index 8d547ea..f53f24b 100644 --- a/core/modules/system/tests/src/Unit/SystemRequirementsTest.php +++ b/core/modules/system/tests/src/Unit/SystemRequirementsTest.php @@ -12,6 +12,7 @@ /** * @coversDefaultClass Drupal\system\SystemRequirements + * @group system */ class SystemRequirementsTest extends UnitTestCase { diff --git a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php b/core/modules/taxonomy/src/Tests/TermTranslationUITest.php index 1386964..5b4f028 100644 --- a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php +++ b/core/modules/taxonomy/src/Tests/TermTranslationUITest.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Tests; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; use Drupal\Core\Language\LanguageInterface; /** @@ -15,7 +15,7 @@ * * @group taxonomy */ -class TermTranslationUITest extends ContentTranslationUITest { +class TermTranslationUITest extends ContentTranslationUITestBase { /** * The vocabulary used for creating terms. @@ -38,7 +38,7 @@ protected function setUp() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupBundle(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::setupBundle(). */ protected function setupBundle() { parent::setupBundle(); @@ -55,14 +55,14 @@ protected function setupBundle() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array('administer taxonomy')); } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues(). */ protected function getNewEntityValues($langcode) { return array('name' => $this->randomMachineName()) + parent::getNewEntityValues($langcode); @@ -88,7 +88,7 @@ protected function getEditValues($values, $langcode, $new = FALSE) { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::testTranslationUI(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::testTranslationUI(). */ public function testTranslationUI() { parent::testTranslationUI(); diff --git a/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php b/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php index be3dd53..490e7e8 100644 --- a/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php +++ b/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\taxonomy\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of taxonomy local tasks. * * @group taxonomy */ -class TaxonomyLocalTasksTest extends LocalTaskIntegrationTest { +class TaxonomyLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('taxonomy' => 'core/modules/taxonomy'); diff --git a/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php b/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php index b82ec79..7c1e17c 100644 --- a/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php +++ b/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\update\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests existence of update local tasks. * * @group update */ -class UpdateLocalTasksTest extends LocalTaskIntegrationTest { +class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('update' => 'core/modules/update'); diff --git a/core/modules/user/src/Tests/UserTranslationUITest.php b/core/modules/user/src/Tests/UserTranslationUITest.php index 8236992..bcdc576 100644 --- a/core/modules/user/src/Tests/UserTranslationUITest.php +++ b/core/modules/user/src/Tests/UserTranslationUITest.php @@ -7,14 +7,14 @@ namespace Drupal\user\Tests; -use Drupal\content_translation\Tests\ContentTranslationUITest; +use Drupal\content_translation\Tests\ContentTranslationUITestBase; /** * Tests the User Translation UI. * * @group user */ -class UserTranslationUITest extends ContentTranslationUITest { +class UserTranslationUITest extends ContentTranslationUITestBase { /** * The user name of the test user. @@ -40,14 +40,14 @@ protected function setUp() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission(). */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array('administer users')); } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues(). */ protected function getNewEntityValues($langcode) { // User name is not translatable hence we use a fixed value. diff --git a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php index fb7bb82..8b8abf5 100644 --- a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php +++ b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\user\Unit\Menu; -use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; +use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase; /** * Tests user local tasks. * * @group user */ -class UserLocalTasksTest extends LocalTaskIntegrationTest { +class UserLocalTasksTest extends LocalTaskIntegrationTestBase { protected function setUp() { $this->directoryList = array('user' => 'core/modules/user'); diff --git a/core/modules/views_ui/src/Tests/XssTest.php b/core/modules/views_ui/src/Tests/XssTest.php index 36c0069..21080cb 100644 --- a/core/modules/views_ui/src/Tests/XssTest.php +++ b/core/modules/views_ui/src/Tests/XssTest.php @@ -8,6 +8,8 @@ namespace Drupal\views_ui\Tests; /** + * Tests the Xss vulnerability. + * * @group views_ui */ class XssTest extends UITestBase { diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php index 416bd0e..859aee6 100644 --- a/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php @@ -18,7 +18,7 @@ * @coversDefaultClass \Drupal\Core\Cache\CacheContextsManager * @group Cache */ -class CacheContextsTest extends UnitTestCase { +class CacheContextsManagerTest extends UnitTestCase { /** * @covers ::optimizeTokens diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php index 95bd570..1c51138 100644 --- a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php +++ b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php @@ -9,6 +9,7 @@ /** * @group Config + * @coversDefaultClass \Drupal\Core\Config\ConfigFactory */ class ConfigFactoryTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php similarity index 98% rename from core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php rename to core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php index 5714849..b58f2a7 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php @@ -20,7 +20,7 @@ * @todo Add tests for access checking and url building, * https://drupal.org/node/2112245. */ -abstract class LocalTaskIntegrationTest extends UnitTestCase { +abstract class LocalTaskIntegrationTestBase extends UnitTestCase { /** * A list of module directories used for YAML searching. diff --git a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php index 1d2942d..732b630 100644 --- a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php @@ -20,7 +20,7 @@ * @coversDefaultClass \Drupal\Core\Routing\CurrentRouteMatch * @group Routing */ -class CurrentRouteMatchTest extends RouteMatchBaseTest { +class CurrentRouteMatchTest extends RouteMatchTestBase { /** * {@inheritdoc} diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php index dfaeabe..4ef6e6e 100644 --- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php @@ -18,7 +18,7 @@ * @coversDefaultClass \Drupal\Core\Routing\RouteMatch * @group Routing */ -class RouteMatchTest extends RouteMatchBaseTest { +class RouteMatchTest extends RouteMatchTestBase { /** * {@inheritdoc} diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteMatchBaseTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php similarity index 98% rename from core/tests/Drupal/Tests/Core/Routing/RouteMatchBaseTest.php rename to core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php index 7994a2d..6d183f3 100644 --- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchBaseTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php @@ -17,7 +17,7 @@ /** * Base test class for testing classes implementing the route match interface. */ -abstract class RouteMatchBaseTest extends UnitTestCase { +abstract class RouteMatchTestBase extends UnitTestCase { /** * Build a test route match object for the given implementation.