diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php b/core/modules/system/tests/src/Kernel/RouteProcessor/RouteNoneTest.php similarity index 98% rename from core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php rename to core/modules/system/tests/src/Kernel/RouteProcessor/RouteNoneTest.php index f029156..0511166 100644 --- a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php +++ b/core/modules/system/tests/src/Kernel/RouteProcessor/RouteNoneTest.php @@ -5,12 +5,12 @@ * Contains \Drupal\system\Tests\RouteProcessor\RouteNoneTest. */ -namespace Drupal\system\Tests\RouteProcessor; +namespace Drupal\Tests\system\Kernel\RouteProcessor; use Drupal\Core\Cache\Cache; use Drupal\Core\GeneratedUrl; use Drupal\Core\Render\BubbleableMetadata; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/modules/system/tests/src/Kernel/RouteProcessor/RouteProcessorCurrentIntegrationTest.php similarity index 98% rename from core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php rename to core/modules/system/tests/src/Kernel/RouteProcessor/RouteProcessorCurrentIntegrationTest.php index 8cdb9c7..39dd77b 100644 --- a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php +++ b/core/modules/system/tests/src/Kernel/RouteProcessor/RouteProcessorCurrentIntegrationTest.php @@ -5,12 +5,12 @@ * Contains \Drupal\system\Tests\RouteProcessor\RouteProcessorCurrentIntegrationTest. */ -namespace Drupal\system\Tests\RouteProcessor; +namespace Drupal\Tests\system\Kernel\RouteProcessor; use Drupal\Core\Cache\Cache; use Drupal\Core\GeneratedUrl; use Drupal\Core\Render\BubbleableMetadata; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; diff --git a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php b/core/modules/system/tests/src/Kernel/Routing/ContentNegotiationRoutingTest.php similarity index 96% rename from core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php rename to core/modules/system/tests/src/Kernel/Routing/ContentNegotiationRoutingTest.php index 71d3fe2..0f71607 100644 --- a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php +++ b/core/modules/system/tests/src/Kernel/Routing/ContentNegotiationRoutingTest.php @@ -5,10 +5,10 @@ * Contains \Drupal\system\Tests\Routing\ContentNegotiationRoutingTest. */ -namespace Drupal\system\Tests\Routing; +namespace Drupal\Tests\system\Kernel\Routing; use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -37,8 +37,8 @@ protected function setUp() { /** * {@inheritdoc} */ - public function containerBuild(ContainerBuilder $container) { - parent::containerBuild($container); + public function register(ContainerBuilder $container) { + parent::register($container); // \Drupal\simpletest\KernelTestBase::containerBuild() removes the alias path // processor. diff --git a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php b/core/modules/system/tests/src/Kernel/Routing/ExceptionHandlingTest.php similarity index 97% rename from core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php rename to core/modules/system/tests/src/Kernel/Routing/ExceptionHandlingTest.php index a404916..9c28daf 100644 --- a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php +++ b/core/modules/system/tests/src/Kernel/Routing/ExceptionHandlingTest.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\system\Tests\Routing\ExceptionHandlingTest. + * Contains \Drupal\Tests\system\Kernel\Routing\ExceptionHandlingTest. */ -namespace Drupal\system\Tests\Routing; +namespace Drupal\Tests\system\Kernel\Routing; use Drupal\Component\Utility\Html; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/core/modules/system/src/Tests/Routing/RouteProviderTest.php b/core/modules/system/tests/src/Kernel/Routing/RouteProviderTest.php similarity index 93% rename from core/modules/system/src/Tests/Routing/RouteProviderTest.php rename to core/modules/system/tests/src/Kernel/Routing/RouteProviderTest.php index 056a37a..151946a 100644 --- a/core/modules/system/src/Tests/Routing/RouteProviderTest.php +++ b/core/modules/system/tests/src/Kernel/Routing/RouteProviderTest.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\system\Tests\Routing\RouteProviderTest. + * Contains \Drupal\Tests\system\Kernel\Routing\RouteProviderTest. */ -namespace Drupal\system\Tests\Routing; +namespace Drupal\Tests\system\Kernel\Routing; use Drupal\Core\Cache\MemoryBackend; use Drupal\Core\Database\Database; @@ -15,14 +15,14 @@ use Drupal\Core\Routing\MatcherDumper; use Drupal\Core\Routing\RouteProvider; use Drupal\Core\State\State; +use Drupal\KernelTests\KernelTestBase; use Drupal\Tests\Core\Routing\RoutingFixtures; -use Drupal\simpletest\KernelTestBase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; /** * Confirm that the default route provider is working correctly. @@ -91,8 +91,8 @@ protected function setUp() { /** * {@inheritdoc} */ - public function containerBuild(ContainerBuilder $container) { - parent::containerBuild($container); // TODO: Change the autogenerated stub + public function register(ContainerBuilder $container) { + parent::register($container); // TODO: Change the autogenerated stub // Readd the incoming path alias for these tests. if ($container->hasDefinition('path_processor_alias')) { @@ -185,7 +185,8 @@ function testOutlinePathMatch() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile()->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); + $this->assertEqual($route->compile() + ->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); @@ -214,7 +215,8 @@ function testOutlinePathMatchTrailingSlash() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile()->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); + $this->assertEqual($route->compile() + ->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); @@ -249,13 +251,13 @@ function testOutlinePathMatchDefaults() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile()->getPatternOutline(), '/some/path', 'Found path has correct pattern'); + $this->assertEqual($route->compile() + ->getPatternOutline(), '/some/path', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); - } - catch (ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -288,13 +290,13 @@ function testOutlinePathMatchDefaultsCollision() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile()->getPatternOutline(), '/some/path', 'Found path has correct pattern'); + $this->assertEqual($route->compile() + ->getPatternOutline(), '/some/path', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); - } - catch (ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -328,12 +330,14 @@ function testOutlinePathMatchDefaultsCollision2() { $routes_array = $routes->all(); $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); - $this->assertEqual(array('narf', 'poink'), array_keys($routes_array), 'Ensure the fitness was taken into account.'); + $this->assertEqual(array( + 'narf', + 'poink' + ), array_keys($routes_array), 'Ensure the fitness was taken into account.'); $this->assertNotNull($routes->get('narf'), 'The first matching route was found.'); $this->assertNotNull($routes->get('poink'), 'The second matching route was found.'); $this->assertNull($routes->get('eep'), 'Non-matching route was not found.'); - } - catch (ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -367,12 +371,14 @@ function testOutlinePathMatchDefaultsCollision3() { $routes_array = $routes->all(); $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); - $this->assertEqual(array('poink', 'poink2'), array_keys($routes_array), 'Ensure the fitness and name were taken into account in the sort.'); + $this->assertEqual(array( + 'poink', + 'poink2' + ), array_keys($routes_array), 'Ensure the fitness and name were taken into account in the sort.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); $this->assertNotNull($routes->get('poink2'), 'The second matching route was found.'); $this->assertNull($routes->get('eep'), 'Non-matching route was not found.'); - } - catch (ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -402,12 +408,12 @@ public function testOutlinePathMatchZero() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile()->getPatternOutline(), '/some/path/%', 'Found path has correct pattern'); + $this->assertEqual($route->compile() + ->getPatternOutline(), '/some/path/%', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); - } - catch (ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { $this->fail('No matchout route found with 0 as argument value'); } } @@ -522,13 +528,16 @@ public function testRouteByName() { $exception_thrown = FALSE; try { $provider->getRouteByName('invalid_name'); - } - catch (RouteNotFoundException $e) { + } catch (RouteNotFoundException $e) { $exception_thrown = TRUE; } $this->assertTrue($exception_thrown, 'Random route was not found.'); - $routes = $provider->getRoutesByNames(array('route_c', 'route_d', $this->randomMachineName())); + $routes = $provider->getRoutesByNames(array( + 'route_c', + 'route_d', + $this->randomMachineName() + )); $this->assertEqual(count($routes), 2, 'Only two valid routes found.'); $this->assertEqual($routes['route_c']->getPath(), '/path/two'); $this->assertEqual($routes['route_d']->getPath(), '/path/three'); diff --git a/core/modules/system/src/Tests/Routing/UrlIntegrationTest.php b/core/modules/system/tests/src/Kernel/Routing/UrlIntegrationTest.php similarity index 91% rename from core/modules/system/src/Tests/Routing/UrlIntegrationTest.php rename to core/modules/system/tests/src/Kernel/Routing/UrlIntegrationTest.php index 1d3f934..83b805e 100644 --- a/core/modules/system/src/Tests/Routing/UrlIntegrationTest.php +++ b/core/modules/system/tests/src/Kernel/Routing/UrlIntegrationTest.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\system\Tests\Routing\UrlIntegrationTest. + * Contains \Drupal\Tests\system\Kernel\Routing\UrlIntegrationTest. */ -namespace Drupal\system\Tests\Routing; +namespace Drupal\Tests\system\Kernel\Routing; use Drupal\Core\Url; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Drupal\user\Entity\Role; use Drupal\user\Entity\User; diff --git a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php b/core/modules/system/tests/src/Kernel/ServiceProvider/ServiceProviderTest.php similarity index 89% rename from core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php rename to core/modules/system/tests/src/Kernel/ServiceProvider/ServiceProviderTest.php index ef2fb79..863b9c2 100644 --- a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php +++ b/core/modules/system/tests/src/Kernel/ServiceProvider/ServiceProviderTest.php @@ -2,12 +2,12 @@ /** * @file - * Contains \Drupal\system\Tests\ServiceProvider\ServiceProviderTest. + * Contains \Drupal\Tests\system\Kernel\ServiceProvider\ServiceProviderTest. */ -namespace Drupal\system\Tests\ServiceProvider; +namespace Drupal\Tests\system\Kernel\ServiceProvider; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; /** * Tests service provider registration to the DIC. @@ -21,7 +21,7 @@ class ServiceProviderTest extends KernelTestBase { * * @var array */ - public static $modules = array('file', 'service_provider_test'); + public static $modules = array('file', 'service_provider_test', 'system'); /** * Tests that services provided by module service providers get registered to the DIC. diff --git a/core/modules/system/src/Tests/Routing/MatcherDumperTest.php b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php similarity index 97% rename from core/modules/system/src/Tests/Routing/MatcherDumperTest.php rename to core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php index f98d294..bfc042d 100644 --- a/core/modules/system/src/Tests/Routing/MatcherDumperTest.php +++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php @@ -2,14 +2,14 @@ /** * @file - * Contains \Drupal\system\Tests\Routing\MatcherDumperTest. + * Contains \Drupal\KernelTests\Core\Routing\MatcherDumperTest. */ -namespace Drupal\system\Tests\Routing; +namespace Drupal\KernelTests\Core\Routing; use Drupal\Core\KeyValueStore\KeyValueMemoryFactory; use Drupal\Core\State\State; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; use Drupal\Core\Database\Database; diff --git a/core/modules/system/src/Tests/Session/AccountSwitcherTest.php b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php similarity index 94% rename from core/modules/system/src/Tests/Session/AccountSwitcherTest.php rename to core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php index edbf6b2..db6997a 100644 --- a/core/modules/system/src/Tests/Session/AccountSwitcherTest.php +++ b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\system\Tests\Session\AccountSwitcherTest. + * Contains \Drupal\KernelTests\Core\Session\AccountSwitcherTest. */ -namespace Drupal\system\Tests\Session; +namespace Drupal\KernelTests\Core\Session; use Drupal\Core\Session\UserSession; -use Drupal\simpletest\KernelTestBase; +use Drupal\KernelTests\KernelTestBase; /** * Test case for account switching.