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:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\action\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to action.settings.yml.
|
||||
*
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
use SchemaCheckTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['action'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d6_action_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests migration of action variables to action.settings.yml.
|
||||
*/
|
||||
public function testActionSettings() {
|
||||
$config = $this->config('action.settings');
|
||||
$this->assertIdentical(35, $config->get('recursion_limit'));
|
||||
$this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\action\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\system\Entity\Action;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Tests migration of action items.
|
||||
*
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateActionsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
public static $modules = ['action', 'comment', 'node'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d6_action');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Drupal 6 action migration to Drupal 8.
|
||||
*/
|
||||
public function testActions() {
|
||||
// Test default actions.
|
||||
$this->assertEntity('node_publish_action', 'Publish post', 'node', []);
|
||||
$this->assertEntity('node_make_sticky_action', 'Make post sticky', 'node', []);
|
||||
$this->assertEntity('user_block_user_action', 'Block current user', 'user', []);
|
||||
$this->assertEntity('comment_publish_action', 'Publish comment', 'comment', []);
|
||||
|
||||
// Test advanced actions.
|
||||
$this->assertEntity('unpublish_comment_containing_keyword_s_', 'Unpublish comment containing keyword(s)', 'comment', ["keywords" => [0 => "drupal"]]);
|
||||
$this->assertEntity('change_the_author_of_a_post', 'Change the author of a post', 'node', ["owner_uid" => "2"]);
|
||||
$this->assertEntity('unpublish_post_containing_keyword_s_', 'Unpublish post containing keyword(s)', 'node', ["keywords" => [0 => "drupal"]]);
|
||||
$this->assertEntity('display_a_message_to_the_user', 'Display a message to the user', 'system', ["message" => "Drupal migration test"]);
|
||||
$this->assertEntity('send_e_mail', 'Send e-mail', 'system', [
|
||||
"recipient" => "test@example.com",
|
||||
"subject" => "Drupal migration test",
|
||||
"message" => "Drupal migration test"
|
||||
]);
|
||||
$this->assertEntity('redirect_to_url', 'Redirect to URL', 'system', ["url" => "https://www.drupal.org"]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts various aspects of an Action entity.
|
||||
*
|
||||
* @param string $id
|
||||
* The expected Action ID.
|
||||
* @param string $label
|
||||
* The expected Action label.
|
||||
* @param string $type
|
||||
* The expected Action type.
|
||||
* @param array $configuration
|
||||
* The expected Action configuration.
|
||||
*/
|
||||
protected function assertEntity($id, $label, $type, $configuration) {
|
||||
$action = Action::load($id);
|
||||
|
||||
$this->assertTrue($action instanceof Action);
|
||||
/** @var \Drupal\system\Entity\Action $action */
|
||||
$this->assertIdentical($id, $action->id());
|
||||
$this->assertIdentical($label, $action->label());
|
||||
$this->assertIdentical($type, $action->getType());
|
||||
$this->assertIdentical($configuration, $action->get('configuration'));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\action\Kernel\Migrate\d7;
|
||||
|
||||
use Drupal\system\Entity\Action;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||
|
||||
/**
|
||||
* Tests migration of action items.
|
||||
*
|
||||
* @group action
|
||||
*/
|
||||
class MigrateActionsTest extends MigrateDrupal7TestBase {
|
||||
|
||||
public static $modules = ['action', 'comment', 'node'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d7_action');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Drupal 7 action migration to Drupal 8.
|
||||
*/
|
||||
public function testActions() {
|
||||
// Test default actions.
|
||||
$this->assertEntity('node_publish_action', 'Publish content', 'node', []);
|
||||
$this->assertEntity('node_make_sticky_action', 'Make content sticky', 'node', []);
|
||||
$this->assertEntity('user_block_user_action', 'Block current user', 'user', []);
|
||||
$this->assertEntity('comment_publish_action', 'Publish comment', 'comment', []);
|
||||
|
||||
// Test advanced actions.
|
||||
$this->assertEntity('unpublish_comment_containing_keyword_s_', 'Unpublish comment containing keyword(s)', 'comment', ["keywords" => [0 => "drupal"]]);
|
||||
$this->assertEntity('change_the_author_of_content', 'Change the author of content', 'node', ["owner_uid" => "2"]);
|
||||
$this->assertEntity('unpublish_content_containing_keyword_s_', 'Unpublish content containing keyword(s)', 'node', ["keywords" => [0 => "drupal"]]);
|
||||
$this->assertEntity('display_a_message_to_the_user', 'Display a message to the user', 'system', ["message" => "Drupal migration test"]);
|
||||
$this->assertEntity('send_e_mail', 'Send e-mail', 'system', [
|
||||
"recipient" => "test@example.com",
|
||||
"subject" => "Drupal migration test",
|
||||
"message" => "Drupal migration test"
|
||||
]);
|
||||
$this->assertEntity('redirect_to_url', 'Redirect to URL', 'system', ["url" => "https://www.drupal.org"]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts various aspects of an Action entity.
|
||||
*
|
||||
* @param string $id
|
||||
* The expected Action ID.
|
||||
* @param string $label
|
||||
* The expected Action label.
|
||||
* @param string $type
|
||||
* The expected Action type.
|
||||
* @param array $configuration
|
||||
* The expected Action configuration.
|
||||
*/
|
||||
protected function assertEntity($id, $label, $type, $configuration) {
|
||||
$action = Action::load($id);
|
||||
|
||||
$this->assertTrue($action instanceof Action);
|
||||
/** @var \Drupal\system\Entity\Action $action */
|
||||
$this->assertIdentical($id, $action->id());
|
||||
$this->assertIdentical($label, $action->label());
|
||||
$this->assertIdentical($type, $action->getType());
|
||||
$this->assertIdentical($configuration, $action->get('configuration'));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\action\Unit\Menu\ActionLocalTasksTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\action\Unit\Menu;
|
||||
|
||||
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\action\Unit\Plugin\migrate\source\ActionTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\action\Unit\Plugin\migrate\source;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
|
Reference in a new issue