Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\Entity\EntityReferenceSelectionReferenceableTest.
*/
namespace Drupal\Tests\system\Kernel\Entity;
use Drupal\Component\Utility\Html;

View file

@ -1,14 +1,10 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\Extension\ModuleHandlerTest.
*/
namespace Drupal\Tests\system\Kernel\Extension;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use \Drupal\Core\Extension\ModuleUninstallValidatorException;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\KernelTests\KernelTestBase;
/**
@ -88,7 +84,7 @@ class ModuleHandlerTest extends KernelTestBase {
* The expected values, sorted by weight and module name.
* @param $condition
*/
protected function assertModuleList(Array $expected_values, $condition) {
protected function assertModuleList(array $expected_values, $condition) {
$expected_values = array_values(array_unique($expected_values));
$enabled_modules = array_keys($this->container->get('module_handler')->getModuleList());
$this->assertEqual($expected_values, $enabled_modules, format_string('@condition: extension handler returns correct results', array('@condition' => $condition)));
@ -238,7 +234,7 @@ class ModuleHandlerTest extends KernelTestBase {
drupal_static_reset('system_rebuild_module_data');
// Create an entity so that the modules can not be disabled.
$entity = entity_create('entity_test', array('name' => $this->randomString()));
$entity = EntityTest::create(array('name' => $this->randomString()));
$entity->save();
// Uninstalling entity_test is not possible when there is content.

View file

@ -0,0 +1,53 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate;
use Drupal\Core\Database\Database;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
use Drupal\system\Entity\Menu;
/**
* Upgrade menus to system.menu.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateMenuTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('menu');
}
/**
* Tests the Drupal 6 menu to Drupal 8 migration.
*/
public function testMenu() {
$navigation_menu = Menu::load('navigation');
$this->assertIdentical('navigation', $navigation_menu->id());
$this->assertIdentical('Navigation', $navigation_menu->label());
$expected = <<<EOT
The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.
EOT;
$this->assertIdentical($expected, $navigation_menu->getDescription());
// Test that we can re-import using the ConfigEntityBase destination.
Database::getConnection('default', 'migrate')
->update('menu_custom')
->fields(array('title' => 'Home Navigation'))
->condition('menu_name', 'navigation')
->execute();
$migration = $this->getMigration('menu');
\Drupal::database()
->truncate($migration->getIdMap()->mapTableName())
->execute();
$this->executeMigration($migration);
$navigation_menu = Menu::load('navigation');
$this->assertIdentical('Home Navigation', $navigation_menu->label());
}
}

View file

@ -0,0 +1,56 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Core\Datetime\Entity\DateFormat;
use Drupal\Core\Database\Database;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade date formats to core.date_format.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateDateFormatTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_date_formats');
}
/**
* Tests the Drupal 6 date formats to Drupal 8 migration.
*/
public function testDateFormats() {
$short_date_format = DateFormat::load('short');
$this->assertIdentical('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern());
$medium_date_format = DateFormat::load('medium');
$this->assertIdentical('\M\E\D\I\U\M D, m/d/Y - H:i', $medium_date_format->getPattern());
$long_date_format = DateFormat::load('long');
$this->assertIdentical('\L\O\N\G l, F j, Y - H:i', $long_date_format->getPattern());
// Test that we can re-import using the EntityDateFormat destination.
Database::getConnection('default', 'migrate')
->update('variable')
->fields(array('value' => serialize('\S\H\O\R\T d/m/Y - H:i')))
->condition('name', 'date_format_short')
->execute();
$migration = $this->getMigration('d6_date_formats');
\Drupal::database()
->truncate($migration->getIdMap()->mapTableName())
->execute();
$this->executeMigration($migration);
$short_date_format = DateFormat::load('short');
$this->assertIdentical('\S\H\O\R\T d/m/Y - H:i', $short_date_format->getPattern());
}
}

View file

@ -0,0 +1,31 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade cron variable to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemCronTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_cron');
}
/**
* Tests migration of system (cron) variables to system.cron.yml.
*/
public function testSystemCron() {
$config = $this->config('system.cron');
$this->assertIdentical(172800, $config->get('threshold.requirements_warning'));
$this->assertIdentical(1209600, $config->get('threshold.requirements_error'));
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade date time variables to system.date config
*
* @group migrate_drupal_6
*/
class MigrateSystemDateTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_date');
}
/**
* Tests migration of user variables to system_date.yml.
*/
public function testSystemDate() {
$config = $this->config('system.date');
$this->assertIdentical(4, $config->get('first_day'));
$this->assertIdentical(FALSE, $config->get('timezone.user.configurable'));
$this->assertIdentical("Europe/Paris", $config->get('timezone.default'));
}
}

View file

@ -0,0 +1,31 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemFileTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_file');
}
/**
* Tests migration of system (file) variables to system.file.yml.
*/
public function testSystemFile() {
$config = \Drupal::configFactory()->getEditable('system.file');
$this->assertIdentical('files/temp', $config->get('path.temporary'));
$this->assertIdentical(TRUE, $config->get('allow_insecure_uploads'));
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade image gd variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemImageGdTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_image_gd');
}
/**
* Tests migration of system (image GD) variables to system.image.gd.yml.
*/
public function testSystemImageGd() {
$config = $this->config('system.image.gd');
$this->assertIdentical(75, $config->get('jpeg_quality'));
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade image variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemImageTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_image');
}
/**
* Tests migration of system (image) variables to system.image.yml.
*/
public function testSystemImage() {
$config = $this->config('system.image');
$this->assertIdentical('gd', $config->get('toolkit'));
}
}

View file

@ -0,0 +1,34 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade error_level variable to system.logging.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemLoggingTest extends MigrateDrupal6TestBase {
use SchemaCheckTestTrait;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_logging');
}
/**
* Tests migration of system error_level variables to system.logging.yml.
*/
public function testSystemLogging() {
$config = $this->config('system.logging');
$this->assertIdentical('some', $config->get('error_level'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'system.logging', $config->get());
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade maintenance variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemMaintenanceTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_maintenance');
}
/**
* Tests migration of system (maintenance) variables to system.maintenance.yml.
*/
public function testSystemMaintenance() {
$config = $this->config('system.maintenance');
$this->assertIdentical('Drupal is currently under maintenance. We should be back shortly. Thank you for your patience.', $config->get('message'));
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade performance variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemPerformanceTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_performance');
}
/**
* Tests migration of system (Performance) variables to system.performance.yml.
*/
public function testSystemPerformance() {
$config = $this->config('system.performance');
$this->assertIdentical(FALSE, $config->get('css.preprocess'));
$this->assertIdentical(FALSE, $config->get('js.preprocess'));
$this->assertIdentical(0, $config->get('cache.page.max_age'));
}
}

View file

@ -0,0 +1,31 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade rss variable to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemRssTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_rss');
}
/**
* Tests migration of system (rss) variables to system.rss.yml.
*/
public function testSystemRss() {
$config = $this->config('system.rss');
$this->assertIdentical(10, $config->get('items.limit'));
$this->assertIdentical('title', $config->get('items.view_mode'));
}
}

View file

@ -0,0 +1,36 @@
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade site variables to system.*.yml.
*
* @group migrate_drupal_6
*/
class MigrateSystemSiteTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_site');
}
/**
* Tests migration of system (site) variables to system.site.yml.
*/
public function testSystemSite() {
$config = $this->config('system.site');
$this->assertIdentical('site_name', $config->get('name'));
$this->assertIdentical('site_mail@example.com', $config->get('mail'));
$this->assertIdentical('Migrate rocks', $config->get('slogan'));
$this->assertIdentical('/user', $config->get('page.403'));
$this->assertIdentical('/page-not-found', $config->get('page.404'));
$this->assertIdentical('/node', $config->get('page.front'));
$this->assertIdentical(FALSE, $config->get('admin_compact_mode'));
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\PathHooksTest.
*/
namespace Drupal\Tests\system\Kernel;
use Drupal\Core\Language\LanguageInterface;
@ -26,8 +21,6 @@ class PathHooksTest extends KernelTestBase {
* Test system_path_*() correctly clears caches.
*/
public function testPathHooks() {
$this->installSchema('system', ['url_alias']);
$source = '/' . $this->randomMachineName();
$alias = '/' . $this->randomMachineName();

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\PhpStorage\PhpStorageFactoryTest.
*/
namespace Drupal\Tests\system\Kernel\PhpStorage;
use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\Scripts\DbDumpCommandTest.
*/
namespace Drupal\Tests\system\Kernel\Scripts;
use Drupal\Core\Command\DbDumpCommand;
@ -35,7 +30,8 @@ class DbDumpCommandTest extends KernelTestBase {
$this->markTestSkipped("Skipping test since the DbDumpCommand is currently only compatible with MySQL");
}
$this->installSchema('system', 'router');
// Rebuild the router to ensure a routing table.
\Drupal::service('router.builder')->rebuild();
/** @var \Drupal\Core\Database\Connection $connection */
$connection = $this->container->get('database');

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\Scripts\DbImportCommandTest.
*/
namespace Drupal\Tests\system\Kernel\Scripts;
use Drupal\Core\Command\DbImportCommand;
@ -42,7 +37,6 @@ class DbImportCommandTest extends KernelTestBase {
'key_value_expire',
'menu_link_content',
'menu_link_content_data',
'semaphore',
'sessions',
'url_alias',
'user__roles',

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Kernel\Scripts\DbToolsApplicationTest.
*/
namespace Drupal\Tests\system\Kernel\Scripts;
use Drupal\Core\Command\DbToolsApplication;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Installer\InstallTranslationFilePatternTest.
*/
namespace Drupal\Tests\system\Unit\Installer;
use Drupal\Core\StringTranslation\Translator\FileTranslation;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest.
*/
namespace Drupal\Tests\system\Unit\Menu;
use Drupal\Core\Access\AccessResult;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Menu\SystemLocalTasksTest.
*/
namespace Drupal\Tests\system\Unit\Menu;
use Drupal\Core\Extension\Extension;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Plugin\migrate\source\MenuTest.
*/
namespace Drupal\Tests\system\Unit\Plugin\migrate\source;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\SystemRequirementsTest.
*/
namespace Drupal\Tests\system\Unit;
use Drupal\system\SystemRequirements;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Transliteration\MachineNameControllerTest.
*/
namespace Drupal\Tests\system\Unit\Transliteration;
use Drupal\Tests\UnitTestCase;