View source
<?php
namespace Drupal\Tests\acquia_contenthub\Kernel;
class NodeImportExportTest extends ImportExportTestBase {
protected $fixtures = [
0 => [
'cdf' => 'node/node_page.json',
'expectations' => 'expectations/node/node_page.php',
],
1 => [
'cdf' => 'node/node-with-embedded-image.json',
'expectations' => 'expectations/node/node_with_embedded_image.php',
],
2 => [
'cdf' => 'node/node-translations.json',
'expectations' => 'expectations/node/node_translations.php',
],
3 => [
'cdf' => 'node/node-translations-non-default-lang-node.json',
'expectations' => 'expectations/node/node_translations_non_default_lang_node.php',
],
4 => [
'cdf' => 'node/node-with-links.json',
'expectations' => 'expectations/node/node_with_links.php',
],
5 => [
'cdf' => 'node/node-with-recursive-deps.json',
'expectations' => 'expectations/node/node_with_recursive_deps.php',
],
6 => [
'cdf' => 'node/node-with-content-moderation.json',
'expectations' => 'expectations/node/node_with_content_moderation.php',
],
];
public static $modules = [
'user',
'node',
'file',
'taxonomy',
'field',
'acquia_contenthub_test',
'content_moderation',
'workflows',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('user');
$this
->installSchema('user', [
'users_data',
]);
$this
->installEntitySchema('node');
$this
->installSchema('node', [
'node_access',
]);
$this
->installEntitySchema('taxonomy_term');
$this
->installEntitySchema('file');
$this
->installSchema('file', [
'file_usage',
]);
$this
->installEntitySchema('workflow');
$this
->installEntitySchema('content_moderation_state');
$this
->drupalSetUpCurrentUser();
}
public function testNodeEntity(...$args) {
parent::contentEntityImportExport(...$args);
}
public function nodeEntityDataProvider() {
$export_uuid = '5d1ba3c3-d527-4328-8fce-a6b714c5ef79';
if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
$export_uuid = '38f023d8-b0d8-4e8c-9c06-8b547d8a0a85';
}
return [
[
0,
[
[
'type' => 'node',
'uuid' => $export_uuid,
],
],
'node',
$export_uuid,
],
[
1,
[
[
'type' => 'node',
'uuid' => 'f88ac4d1-50b9-4d39-b870-e97fa685e248',
],
[
'type' => 'file',
'uuid' => '219ebded-70e6-459c-b29b-7686102e9bf3',
],
],
'node',
'f88ac4d1-50b9-4d39-b870-e97fa685e248',
],
[
2,
[
[
'type' => 'node',
'uuid' => 'b0137bab-a80e-4305-84fe-4d99ffd906c5',
],
],
'node',
'b0137bab-a80e-4305-84fe-4d99ffd906c5',
],
[
3,
[
[
'type' => 'node',
'uuid' => 'c3910d90-e4ff-467e-9bb4-5c1b5bb43008',
],
],
'node',
'c3910d90-e4ff-467e-9bb4-5c1b5bb43008',
],
[
4,
[
[
'type' => 'node',
'uuid' => 'fcec27d0-eb50-4ef4-8fb5-2cc736414a7f',
],
],
'node',
'fcec27d0-eb50-4ef4-8fb5-2cc736414a7f',
],
[
5,
[
[
'type' => 'node',
'uuid' => 'd1aee8f8-e868-496d-a8f7-5b9a8df2de7e',
],
],
'node',
'd1aee8f8-e868-496d-a8f7-5b9a8df2de7e',
],
[
6,
[
[
'type' => 'node',
'uuid' => '3405e162-4b3e-42ca-aa7b-9ba9fc78eb02',
],
],
'node',
'3405e162-4b3e-42ca-aa7b-9ba9fc78eb02',
],
];
}
}