Browse Source

Issue #3089624 by chr.fritsch: Make Thunder Drupal 8.8.x compatible

tags/3.4.0
Christian Fritsch 9 months ago
parent
commit
f41634f095
24 changed files with 164 additions and 44 deletions
  1. +1
    -1
      .github/PULL_REQUEST_TEMPLATE.md
  2. +1
    -1
      README.md
  3. +1
    -1
      build-thunder.make
  4. +12
    -6
      composer.json
  5. +1
    -0
      config/install/field.field.node.page.body.yml
  6. +1
    -1
      config/install/simple_sitemap.settings.yml
  7. +14
    -0
      config/install/views.view.scheduler_scheduled_content.yml
  8. +1
    -1
      config/optional/linkit.linkit_profile.default.yml
  9. +17
    -0
      config/optional/views.view.content.yml
  10. +4
    -0
      config/optional/views.view.entity_browser.yml
  11. +55
    -3
      config/optional/views.view.media.yml
  12. +1
    -1
      docs/development.md
  13. +2
    -2
      drupal-org-core.make
  14. +5
    -3
      drupal-org.make
  15. +0
    -5
      phpstan.neon.dist
  16. +1
    -1
      scripts/travis/03-build-thunder-composer.sh
  17. +1
    -2
      scripts/travis/03-build-thunder-drush.sh
  18. +1
    -0
      tests/src/Functional/InstalledConfigurationTest.php
  19. +5
    -4
      tests/src/Functional/Installer/ThunderInstallerTest.php
  20. +3
    -3
      tests/src/FunctionalJavascript/ArticleCreationTest.php
  21. +6
    -5
      tests/src/FunctionalJavascript/ModeratedContentSchedulingTest.php
  22. +1
    -1
      tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php
  23. +24
    -0
      tests/src/Traits/ThunderTestTrait.php
  24. +6
    -3
      thunder.profile

+ 1
- 1
.github/PULL_REQUEST_TEMPLATE.md View File

@@ -1,7 +1,7 @@
Make sure these boxes are checked before submitting your pull request - thank you!

- [ ] All coding styles are fulfilled. ([How to check for cs issues?](https://github.com/BurdaMagazinOrg/thunder-dev-tools/blob/master/README.md#code-style-guidelines))
- [ ] All tests are running locally. ([How to run the test?](https://github.com/thunder/thunder-distribution/blob/8.x-3.x/docs/development.md#how-to-run-the-tests))
- [ ] All tests are running locally. ([How to run the test?](https://github.com/thunder/thunder-distribution/blob/8.x-4.x/docs/development.md#how-to-run-the-tests))
- [ ] Necessary update hooks are provided.
- [ ] User roles have correct access for new introduced permission.
- [ ] Every thunder module has a README.md in its root. Follow [this guidelines](https://www.drupal.org/node/2181737), but we don't need every topic.


+ 1
- 1
README.md View File

@@ -1,6 +1,6 @@
# <img src="./files/images/thunder.svg?sanitize=true" alt="Thunder" width="4%"/> Thunder [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=I%20just%20tried%20ThunderCMS.%20The%20CMS%20for%20professional%20publishing!&url=https://www.thunder.org&via=ThunderCoreTeam&hashtags=drupal8,publishing,ThunderCMS)

[![Build Status](https://travis-ci.com/thunder/thunder-distribution.svg?branch=8.x-3.x)](https://travis-ci.com/thunder/thunder-distribution)
[![Build Status](https://travis-ci.com/thunder/thunder-distribution.svg?branch=8.x-4.x)](https://travis-ci.com/thunder/thunder-distribution)

Thunder is a Drupal 8 distribution for professional publishers. It consists of the current Drupal 8 functionality, lots of useful modules from publishers and industry partners, and an environment which makes it easy to install, deploy and add new functionality.



+ 1
- 1
build-thunder.make View File

@@ -3,4 +3,4 @@ core = 8.x
includes[] = drupal-org-core.make
projects[thunder][type] = profile
projects[thunder][download][type] = git
projects[thunder][download][branch] = 8.x-3.x
projects[thunder][download][branch] = 8.x-4.x

+ 12
- 6
composer.json View File

@@ -76,10 +76,16 @@
"Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2019-05-20/password_policy-config_import_field_error-2771129-80.patch"
},
"drupal/core": {
"Switch to a memory backend for running the database updates": "https://www.drupal.org/files/issues/2019-07-22/3055443-2-37.patch"
"temporary://update-cache-60b12ec6 is not a directory. in FileSystem->scanDirectory()": "https://www.drupal.org/files/issues/2019-10-21/3075645-6.patch"
},
"drupal/inline_entity_form": {
"Remove revision log": "https://www.drupal.org/files/issues/2019-07-16/inline_entity_form-remove_log_message-2927884-6.patch"
},
"drupal/redirect": {
"Update view to met the Drupal 8.8 views schema": "https://www.drupal.org/files/issues/2019-10-22/3089389.patch"
},
"drupal/content_lock": {
"Update view to met the Drupal 8.8 views schema": "https://www.drupal.org/files/issues/2019-10-23/3089617.patch"
}
}
},
@@ -97,10 +103,10 @@
"drupal/better_normalizers": "^1.0-beta3",
"drupal/blazy": "^2.0-rc3",
"drupal/checklistapi": "^1.8",
"drupal/core": "8.7.8",
"drupal/core": "^8.8.0",
"drupal/config_selector": "^1.0-beta1",
"drupal/config_update": "^1.5",
"drupal/content_lock": "^1.0-alpha8",
"drupal/content_lock": "1.0-alpha8",
"drupal/crop": "^2.0-rc1",
"drupal/ctools": "^3.1",
"drupal/default_content": "^1.0-alpha7",
@@ -129,9 +135,9 @@
"drupal/paragraphs": "^1.9",
"drupal/paragraphs_features": "^1.0",
"drupal/password_policy": "3.0-alpha5",
"drupal/pathauto": "^1.0",
"drupal/pathauto": "^1.6",
"drupal/responsive_preview": "^1.0-alpha7",
"drupal/redirect": "^1.0",
"drupal/redirect": "1.4",
"drupal/scheduler": "^1.1",
"drupal/scheduler_content_moderation_integration": "^1.1",
"drupal/select2": "^1.3",
@@ -140,7 +146,7 @@
"drupal/shariff": "^1.5",
"drupal/slick": "^2.0-rc3",
"drupal/slick_media": "^2.0-alpha2",
"drupal/thunder_admin": "^3.0",
"drupal/thunder_admin": "3.x-dev",
"drupal/token": "^1.0",
"drupal/update_helper": "^1.0",
"npm-asset/dropzone": "^5.5.1",


+ 1
- 0
config/install/field.field.node.page.body.yml View File

@@ -18,4 +18,5 @@ default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
field_type: text_with_summary

+ 1
- 1
config/install/simple_sitemap.settings.yml View File

@@ -8,7 +8,7 @@ xsl: true
base_url: ''
default_variant: default
custom_links_include_images: false
excluded_languages: []
excluded_languages: { }
enabled_entity_types:
- node
- taxonomy_term

+ 14
- 0
config/install/views.view.scheduler_scheduled_content.yml View File

@@ -641,6 +641,8 @@ display:
multiple: false
remember_roles:
authenticated: authenticated
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -678,6 +680,8 @@ display:
multiple: false
remember_roles:
authenticated: authenticated
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: 'Published status'
@@ -727,6 +731,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -772,6 +778,8 @@ display:
placeholder: ''
min_placeholder: ''
max_placeholder: ''
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -817,6 +825,8 @@ display:
placeholder: ''
min_placeholder: ''
max_placeholder: ''
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -861,6 +871,8 @@ display:
seo: '0'
administrator: '0'
placeholder: ''
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -902,6 +914,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''


+ 1
- 1
config/optional/linkit.linkit_profile.default.yml View File

@@ -4,7 +4,7 @@ dependencies:
module:
- node
id: default
label: 'Default'
label: Default
description: ''
matchers:
abb64004-44db-4254-8189-1a06a4b8c830:


+ 17
- 0
config/optional/views.view.content.yml View File

@@ -481,6 +481,9 @@ display:
plugin_id: node_status
group: 1
entity_type: node
expose:
operator_limit_selection: false
operator_list: { }
status:
id: status
table: node_field_data
@@ -504,6 +507,8 @@ display:
multiple: false
remember_roles:
authenticated: authenticated
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: 'Published status'
@@ -553,6 +558,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -593,6 +600,8 @@ display:
authenticated: authenticated
anonymous: '0'
administrator: '0'
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -636,6 +645,8 @@ display:
seo: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -677,6 +688,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -719,6 +732,8 @@ display:
editor: '0'
seo: '0'
administrator: '0'
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: Promoted
@@ -769,6 +784,8 @@ display:
editor: '0'
seo: '0'
administrator: '0'
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: Sticky


+ 4
- 0
config/optional/views.view.entity_browser.yml View File

@@ -352,6 +352,8 @@ display:
multiple: false
remember_roles:
authenticated: authenticated
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: 'Publishing status'
@@ -402,6 +404,8 @@ display:
editor: '0'
seo: '0'
administrator: '0'
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''


+ 55
- 3
config/optional/views.view.media.yml View File

@@ -12,7 +12,7 @@ dependencies:
id: media
label: Media
module: views
description: ''
description: 'Find and manage media.'
tag: ''
base_table: media_field_data
base_field: mid
@@ -184,8 +184,11 @@ display:
hide_empty: false
empty_zero: false
hide_alter_empty: true
action_title: Action
include_exclude: exclude
selected_actions: { }
entity_type: media
plugin_id: media_bulk_form
plugin_id: bulk_form
thumbnail__target_id:
id: thumbnail__target_id
table: media_field_data
@@ -704,6 +707,8 @@ display:
authenticated: authenticated
anonymous: '0'
administrator: '0'
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -745,6 +750,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -783,6 +790,8 @@ display:
multiple: false
remember_roles:
authenticated: authenticated
operator_limit_selection: false
operator_list: { }
is_grouped: true
group_info:
label: 'Published status'
@@ -806,6 +815,45 @@ display:
plugin_id: boolean
entity_type: media
entity_field: status
status_extra:
id: status_extra
table: media_field_data
field: status_extra
relationship: none
group_type: group
admin_label: ''
operator: '='
value: ''
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: media
plugin_id: media_status
langcode:
id: langcode
table: media_field_data
@@ -832,6 +880,8 @@ display:
anonymous: '0'
administrator: '0'
reduce: false
operator_limit_selection: false
operator_list: { }
is_grouped: false
group_info:
label: ''
@@ -876,7 +926,7 @@ display:
admin_label: ''
empty: true
tokenize: false
content: 'No content available.'
content: 'No media available.'
plugin_id: text_custom
relationships: { }
arguments: { }
@@ -888,6 +938,7 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- user.permissions
tags:
- 'config:field.storage.media.field_expires'
@@ -916,6 +967,7 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- user.permissions
tags:
- 'config:field.storage.media.field_expires'

+ 1
- 1
docs/development.md View File

@@ -111,7 +111,7 @@ That information will be picked up by testing classes and used for selenium endp
1. You need to install [Yarn](https://yarnpkg.com). Please check installation documentation for it.
2. You have to install `thunder/thunder_performance_measurement` package. To do that, execute the following command in your project root directory: `composer require thunder/thunder_performance_measurement:dev-master --dev` and enable module by executing: `drush en thunder_performance_measurement` in your `docroot` directory.
3. You need to install [Elastic APM Node.js Agent](https://www.npmjs.com/package/elastic-apm-node) in Drupal Core node packages. To do that go to your `docroot/core` directory and execute following command: `yarn add elastic-apm-node --dev`
4. You have to adjust your `.env` file inside `docroot/core` directory. You can copy the `.env.example` to `.env` and edit it accordingly. Thunder tests require the following environment variables: `DRUPAL_TEST_BASE_URL`, `THUNDER_BRANCH`, `THUNDER_SITE_HOSTNAME` and `THUNDER_APM_URL`. The `THUNDER_BRANCH` is branch name where tests are executing, for example, `8.x-3.x`. The `THUNDER_SITE_HOSTNAME` is hostname where tests are executing, for example `thunder.dev`. The `THUNDER_APM_URL` is URL to Elastic APM Server, for example `http://localhost:8200`.
4. You have to adjust your `.env` file inside `docroot/core` directory. You can copy the `.env.example` to `.env` and edit it accordingly. Thunder tests require the following environment variables: `DRUPAL_TEST_BASE_URL`, `THUNDER_BRANCH`, `THUNDER_SITE_HOSTNAME` and `THUNDER_APM_URL`. The `THUNDER_BRANCH` is branch name where tests are executing, for example, `8.x-4.x`. The `THUNDER_SITE_HOSTNAME` is hostname where tests are executing, for example `thunder.dev`. The `THUNDER_APM_URL` is URL to Elastic APM Server, for example `http://localhost:8200`.
5. After that, you can run NightwatchJS tests by executing the following command inside `docroot/core` directory: `yarn test:nightwatch <path to JS Test file>`. Here is an example: `yarn test:nightwatch ../profiles/contrib/thunder/tests/src/Nightwatch/Tests/CreateMostUsedContent.js`

----------


+ 2
- 2
drupal-org-core.make View File

@@ -1,5 +1,5 @@
api = 2
core = 8.x
projects[drupal][type] = core
projects[drupal][version] = 8.7.8
projects[drupal][patch][] = https://www.drupal.org/files/issues/2019-07-22/3055443-2-37.patch
projects[drupal][version] = 8.8.0-alpha1
projects[drupal][patch][] = https://www.drupal.org/files/issues/2019-10-21/3075645-6.patch

+ 5
- 3
drupal-org.make View File

@@ -24,7 +24,8 @@ projects[config_selector][version] = 1
projects[config_update][type] = module
projects[config_update][version] = 1
projects[content_lock][type] = module
projects[content_lock][version] = 1
projects[content_lock][version] = 1.0-alpha8
projects[content_lock][patch][] = https://www.drupal.org/files/issues/2019-10-23/3089617.patch
projects[crop][type] = module
projects[crop][version] = 2
projects[ctools][type] = module
@@ -92,13 +93,14 @@ projects[password_policy][version] = 3.0-alpha5
projects[password_policy][patch][] = https://www.drupal.org/files/issues/2018-10-09/2918974-2.patch
projects[password_policy][patch][] = https://www.drupal.org/files/issues/2019-05-20/password_policy-config_import_field_error-2771129-80.patch
projects[pathauto][type] = module
projects[pathauto][version] = 1
projects[pathauto][version] = 1.6-alpha1
projects[responsive_preview][type] = module
projects[responsive_preview][version] = 1
projects[riddle_marketplace][type] = module
projects[riddle_marketplace][version] = 3
projects[redirect][type] = module
projects[redirect][version] = 1
projects[redirect][version] = 1.4
projects[redirect][patch][] = https://www.drupal.org/files/issues/2019-10-22/3089389.patch
projects[scheduler][type] = module
projects[scheduler][version] = 1
projects[scheduler_content_moderation_integration][type] = module


+ 0
- 5
phpstan.neon.dist View File

@@ -7,11 +7,6 @@ parameters:
- '#Plugin definitions cannot be altered.#'
- '#Missing cache backend declaration for performance.#'
- '#Plugin manager has cache backend specified but does not declare cache tags.#'
#TODO: Remove when https://www.drupal.org/project/drupal/issues/2367933 is fixed.
- '#Call to deprecated function entity_get_display().#'
- '#Call to deprecated function entity_get_form_display().#'
#TODO: Remove when https://www.drupal.org/project/drupal/issues/2869573 is fixed.
- '#Call to deprecated method prepareLegacyRequest\(\) of class Drupal\\Core\\DrupalKernel.#'
autoload_files:
- docroot/modules/contrib/token/token.module
includes:


+ 1
- 1
scripts/travis/03-build-thunder-composer.sh View File

@@ -19,7 +19,7 @@ if [[ ${TEST_UPDATE} == "true" ]]; then
fi

composer config repositories.thunder path ${THUNDER_DIST_DIR}
composer require "thunder/thunder-distribution:*" "thunder/thunder_testing_demo:3.x-dev" "phpunit/phpunit:^6.5" "symfony/browser-kit:^4.0.0" "mglaman/phpstan-drupal" "phpstan/phpstan:0.11.6" "phpstan/phpstan-deprecation-rules:0.11.1" "drupal/riddle_marketplace:^3.0-beta2" "drupal/nexx_integration:^1.0" "valiton/harbourmaster:~8.1" --no-progress ${ADDITIONAL_COMPOSER_PARAMETERS}
composer require "thunder/thunder-distribution:*" "thunder/thunder_testing_demo:3.x-dev" "phpunit/phpunit:^6.5" "composer/composer:^1.9.0" "mglaman/phpstan-drupal:^0.11.11" "phpstan/phpstan-deprecation-rules" "drupal/riddle_marketplace:^3.0-beta2" "drupal/nexx_integration:^1.0" "valiton/harbourmaster:~8.1" --no-progress ${ADDITIONAL_COMPOSER_PARAMETERS}

# Get custom branch of Thunder Admin theme
rm -rf ${TEST_DIR}/docroot/themes/contrib/thunder_admin


+ 1
- 2
scripts/travis/03-build-thunder-drush.sh View File

@@ -15,7 +15,6 @@ rm -rf ${TEST_DIR}/docroot/profiles/thunder/themes/thunder_admin
git clone --depth 1 --single-branch --branch ${THUNDER_ADMIN_BRANCH} https://github.com/BurdaMagazinOrg/theme-thunder-admin.git ${TEST_DIR}/docroot/profiles/thunder/themes/thunder_admin

composer install --working-dir=${TEST_DIR}/docroot
composer run-script drupal-phpunit-upgrade --working-dir=${TEST_DIR}/docroot

# require development packages needed for testing
composer require "thunder/thunder_testing_demo:3.x-dev" "behat/mink-selenium2-driver" "behat/mink-goutte-driver" "mikey179/vfsStream" "lullabot/amp" "pusher/pusher-php-server:^3.0.0" --no-progress --working-dir ${TEST_DIR}/docroot
COMPOSER_ROOT_VERSION=8.8.x-dev composer require "thunder/thunder_testing_demo:3.x-dev" "behat/mink-selenium2-driver" "behat/mink-goutte-driver" "mikey179/vfsStream" "lullabot/amp" "pusher/pusher-php-server:^3.0.0" --no-progress --working-dir ${TEST_DIR}/docroot

+ 1
- 0
tests/src/Functional/InstalledConfigurationTest.php View File

@@ -90,6 +90,7 @@ class InstalledConfigurationTest extends ThunderTestBase {
'core.entity_view_mode.paragraph.token',
'core.entity_view_mode.taxonomy_term.token',
'core.entity_view_mode.user.token',
'core.entity_view_mode.path_alias.token',
];

/**


+ 5
- 4
tests/src/Functional/Installer/ThunderInstallerTest.php View File

@@ -120,9 +120,7 @@ class ThunderInstallerTest extends InstallerTestBase {
$request = Request::createFromGlobals();
$class_loader = require $this->container->get('app.root') . '/autoload.php';
Settings::initialize($this->container->get('app.root'), DrupalKernel::findSitePath($request), $class_loader);
foreach ($GLOBALS['config_directories'] as $type => $path) {
$this->configDirectories[$type] = $path;
}
$this->configDirectories['sync'] = Settings::get('config_sync_directory');

// After writing settings.php, the installer removes write permissions
// from the site directory. To allow drupal_generate_test_ua() to write
@@ -132,7 +130,8 @@ class ThunderInstallerTest extends InstallerTestBase {
// Not using File API; a potential error must trigger a PHP warning.
chmod($this->container->get('app.root') . '/' . $this->siteDirectory, 0777);
$this->kernel = DrupalKernel::createFromRequest($request, $class_loader, 'prod', FALSE);
$this->kernel->prepareLegacyRequest($request);
$this->kernel->boot();
$this->kernel->preHandle($request);
$this->container = $this->kernel->getContainer();

// Manually configure the test mail collector implementation to prevent
@@ -141,6 +140,8 @@ class ThunderInstallerTest extends InstallerTestBase {
->getEditable('system.mail')
->set('interface.default', 'test_mail_collector')
->save();

$this->installDefaultThemeFromClassProperty($this->container);
}
}



+ 3
- 3
tests/src/FunctionalJavascript/ArticleCreationTest.php View File

@@ -174,12 +174,12 @@ class ArticleCreationTest extends ThunderJavascriptTestBase {

$this->assertPageTitle('Massive gaining even more and more seo traffic text');

/** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */
$moderation_info = \Drupal::service('content_moderation.moderation_information');
/** @var \Drupal\node\NodeStorageInterface $node_storage */
$node_storage = \Drupal::entityTypeManager()->getStorage('node');

$revert_url = Url::fromRoute('node.revision_revert_default_confirm', [
'node' => $node->id(),
'node_revision' => $moderation_info->getLatestRevisionId('node', $node->id()),
'node_revision' => $node_storage->getLatestRevisionId($node->id()),
]);
$this->drupalPostForm($revert_url, [], $this->t('Revert'));



+ 6
- 5
tests/src/FunctionalJavascript/ModeratedContentSchedulingTest.php View File

@@ -18,8 +18,8 @@ class ModeratedContentSchedulingTest extends ThunderJavascriptTestBase {
*/
public function testPublishStateSchedule() {
$publish_timestamp = strtotime('yesterday');
/* @var $moderation_info \Drupal\content_moderation\ModerationInformationInterface */
$moderation_info = $this->container->get('content_moderation.moderation_information');
/** @var \Drupal\node\NodeStorageInterface $node_storage */
$node_storage = \Drupal::entityTypeManager()->getStorage('node');

$this->articleFillNew([
'field_channel' => 1,
@@ -39,7 +39,7 @@ class ModeratedContentSchedulingTest extends ThunderJavascriptTestBase {
$this->assertEquals(FALSE, Node::load($node->id())->isPublished());
$this->container->get('cron')->run();

$node = $moderation_info->getLatestRevision('node', $node->id());
$node = $node_storage->loadRevision($node_storage->getLatestRevisionId($node->id()));
// Assert node is now published.
$this->assertEquals(TRUE, $node->isPublished());
$this->assertEquals('published', $node->moderation_state->value);
@@ -57,13 +57,14 @@ class ModeratedContentSchedulingTest extends ThunderJavascriptTestBase {
'publish_state[0]' => 'published',
]);
$this->clickSave();
$node_storage->resetCache([$node->id()]);

$node = $moderation_info->getLatestRevision('node', $node->id());
$node = $node_storage->loadRevision($node_storage->getLatestRevisionId($node->id()));
$this->assertEquals('Test workflow article 1 - Draft', $node->getTitle());
$this->assertEquals('draft', $node->moderation_state->value);
$this->container->get('cron')->run();

$node = $moderation_info->getLatestRevision('node', $node->id());
$node = $node_storage->loadRevision($node_storage->getLatestRevisionId($node->id()));
$this->assertEquals(TRUE, $node->isPublished());
$this->assertEquals('published', $node->moderation_state->value);
$this->assertEquals('Test workflow article 1 - Draft', $node->getTitle());


+ 1
- 1
tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php View File

@@ -172,7 +172,7 @@ abstract class ThunderJavascriptTestBase extends WebDriverTestBase {
var element = jQuery(\'' . addcslashes($cssSelector, '\'') . '\');
var scrollTop = element.offset().top - (viewPortHeight/2);
var scrollableParent = jQuery.isFunction(element.scrollParent) ? element.scrollParent() : [];
if (scrollableParent.length > 0 && scrollableParent[0] !== document && scrollableParent[0] !== document.body) { scrollableParent[0].scrollTop = scrollTop } else { window.scroll(0, scrollTop); };
if (scrollableParent.length > 0 && scrollableParent[0] !== document && scrollableParent[0] !== document.body) { scrollableParent[0].scrollTop = scrollableParent[0].scrollTop + scrollTop - scrollableParent.offset().top } else { window.scroll(0, scrollTop); };
');
}



+ 24
- 0
tests/src/Traits/ThunderTestTrait.php View File

@@ -6,6 +6,8 @@ use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Database;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Site\Settings;
use Drupal\dblog\Controller\DbLogController;
use Symfony\Component\HttpFoundation\Request;

@@ -25,6 +27,16 @@ trait ThunderTestTrait {
$request = Request::createFromGlobals();
$container = $this->initKernel($request);
$this->initConfig($container);

// Add the config directories to settings.php.
$sync_directory = Settings::get('config_sync_directory');
\Drupal::service('file_system')->prepareDirectory($sync_directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);

// Ensure the default temp directory exist and is writable. The configured
// temp directory may be removed during update.
\Drupal::service('file_system')->prepareDirectory($this->tempFilesDirectory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);

$this->installDefaultThemeFromClassProperty($container);
$this->installModulesFromClassProperty($container);
$this->rebuildAll();
}
@@ -52,6 +64,18 @@ trait ThunderTestTrait {
'required' => TRUE,
];

// Force every update hook to only run one entity per batch.
$settings['entity_update_batch_size'] = (object) [
'value' => 1,
'required' => TRUE,
];

// Set up sync directory.
$settings['settings']['config_sync_directory'] = (object) [
'value' => $this->publicFilesDirectory . '/config_sync',
'required' => TRUE,
];

$this->writeSettings($settings);
}



+ 6
- 3
thunder.profile View File

@@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\block\Entity\Block;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\user\Entity\User;
use Drupal\user\Entity\Role;

@@ -218,7 +219,7 @@ function _thunder_check_triggering_modules(array $modules, array $triggering_mod
* Returns if enabling of a module is currently running.
*/
function _thunder_is_enabling_module() {
return !drupal_installation_attempted() && !Drupal::isConfigSyncing();
return !InstallerKernel::installationAttempted() && !Drupal::isConfigSyncing();
}

/**
@@ -278,7 +279,8 @@ function thunder_modules_installed($modules) {
// Attach field if channel vocabulary and article node type is
// present in the distribution.
try {
entity_get_form_display('node', 'article', 'default')
\Drupal::service('entity_display.repository')
->getFormDisplay('node', 'article', 'default')
->setComponent(
'field_ivw', [
'type' => $fieldWidget,
@@ -289,7 +291,8 @@ function thunder_modules_installed($modules) {
}

try {
entity_get_form_display('taxonomy_term', 'channel', 'default')
\Drupal::service('entity_display.repository')
->getFormDisplay('taxonomy_term', 'channel', 'default')
->setComponent('field_ivw', [
'type' => $fieldWidget,
])->save();


Loading…
Cancel
Save