Commit 0018b94f authored by alexpott's avatar alexpott
Browse files

Issue #2456477 by Berdir, dawehner, heddn, pguillard: Convert deprecated...

Issue #2456477 by Berdir, dawehner, heddn, pguillard: Convert deprecated \Drupal\simpletest\KernelTestBase tests to KernelTestBaseNG
parent ea8e16ed
<?php
namespace Drupal\editor\Tests;
namespace Drupal\Tests\editor\Kernel;
use Drupal\Component\Serialization\Json;
use Drupal\Core\EventSubscriber\AjaxResponseSubscriber;
......@@ -8,7 +8,7 @@
use Drupal\editor\Entity\Editor;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\quickedit\MetadataGenerator;
use Drupal\quickedit\Tests\QuickEditTestBase;
use Drupal\Tests\quickedit\Kernel\QuickEditTestBase;
use Drupal\quickedit_test\MockEditEntityFieldAccessCheck;
use Drupal\editor\EditorController;
use Symfony\Component\HttpFoundation\Request;
......
<?php
namespace Drupal\forum\Tests;
namespace Drupal\Tests\forum\Kernel;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\taxonomy\Entity\Term;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
/**
* Tests forum validation constraints.
*
* @group forum
*/
class ForumValidationTest extends EntityUnitTestBase {
class ForumValidationTest extends EntityKernelTestBase {
/**
* Modules to install.
......
<?php
namespace Drupal\language\Tests\Condition;
namespace Drupal\Tests\language\Kernel\Condition;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests that the language condition, provided by the language module, is
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
use Drupal\language\Entity\ConfigurableLanguage;
/**
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ContentLanguageSettings;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests default language code is properly generated for entities.
......@@ -18,7 +18,7 @@ class EntityDefaultLanguageTest extends KernelTestBase {
*
* @var array
*/
public static $modules = array('language', 'node', 'field', 'text', 'user');
public static $modules = array('language', 'node', 'field', 'text', 'user', 'system');
/**
* {@inheritdoc}
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\Core\Language\LanguageInterface;
use Drupal\entity_test\Entity\EntityTest;
......@@ -46,7 +46,8 @@ protected function setUp() {
$config = $this->config('language.negotiation');
$config->set('url.prefixes', ['en' => 'en', 'es' => 'es', 'fr' => 'fr'])
->save();
$this->kernel->rebuildContainer();
\Drupal::service('kernel')->rebuildContainer();
$this->createTranslatableEntity();
}
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Ensures the language config overrides can be installed.
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\language\Exception\DeleteDefaultLanguageException;
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ConfigurableLanguage;
......
<?php
namespace Drupal\language\Tests;
namespace Drupal\Tests\language\Kernel;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Test for dependency injected language object.
......
......@@ -1042,7 +1042,7 @@ function locale_string_is_safe($string) {
// inject javascript. When \Drupal\Component\Utility\Xss::filter() removes
// part of tokens, it causes the string to not be translatable when it should
// be translatable.
// @see \Drupal\locale\Tests\LocaleStringIsSafeTest::testLocaleStringIsSafe()
// @see \Drupal\Tests\locale\Kernel\LocaleStringIsSafeTest::testLocaleStringIsSafe()
//
// We can recognize tokens since they are wrapped with brackets and are only
// composed of alphanumeric characters, colon, underscore, and dashes. We can
......
......@@ -7,7 +7,7 @@ locale_test.no_translation:
test:
type: string
label: 'Test'
# See \Drupal\locale\Tests\LocaleConfigSubscriberTest
# See \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest
translatable: true
locale_test.translation:
......@@ -17,5 +17,5 @@ locale_test.translation:
test:
type: string
label: 'Test'
# See \Drupal\locale\Tests\LocaleConfigSubscriberTest
# See \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest
translatable: true
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\block\Entity\Block;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests that the locale config manager operates correctly.
......
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\Language\Language;
use Drupal\language\Entity\ConfigurableLanguage;
......@@ -15,11 +16,13 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* {@inheritdoc}
*/
protected function defaultLanguageData() {
$data = Language::$defaultValues;
$data['id'] = 'hu';
$data['name'] = 'Hungarian';
return $data;
public function register(ContainerBuilder $container) {
parent::register($container);
$language = Language::$defaultValues;
$language['id'] = 'hu';
$language['name'] = 'Hungarian';
$container->setParameter('language.default_values', $language);
}
/**
......
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\locale\Locale;
use Drupal\locale\StringInterface;
use Drupal\locale\TranslationString;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests that shipped configuration translations are updated correctly.
......@@ -18,7 +18,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['language', 'locale', 'system'];
public static $modules = ['language', 'locale', 'system', 'locale_test'];
/**
* The configurable language manager used in this test.
......@@ -60,7 +60,6 @@ protected function setUp() {
$this->setupLanguages();
$this->enableModules(['locale_test']);
$this->installConfig(['locale_test']);
// Simulate this hook invoked which would happen if in a non-kernel test
// or normal environment.
......
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
......
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests locale translation safe string handling.
......
<?php
namespace Drupal\locale\Tests;
namespace Drupal\Tests\locale\Kernel;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests locale translation project handling.
......@@ -14,7 +14,7 @@ class LocaleTranslationProjectsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['locale', 'locale_test'];
public static $modules = ['locale', 'locale_test', 'system'];
/**
* The module handler used in this test.
......
<?php
namespace Drupal\menu_link_content\Tests;
namespace Drupal\Tests\menu_link_content\Kernel;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
use Drupal\user\Entity\User;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
......
<?php
namespace Drupal\menu_link_content\Tests;
namespace Drupal\Tests\menu_link_content\Kernel;
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\simpletest\KernelTestBase;
use Drupal\KernelTests\KernelTestBase;
use Symfony\Component\Routing\Route;
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment