Skip to content
Snippets Groups Projects
Verified Commit aed5e43a authored by Dave Long's avatar Dave Long
Browse files

Issue #3447994 by Akhil Babu, Josue2591, thejimbirch, mikelutz, jnicola,...

Issue #3447994 by Akhil Babu, Josue2591, thejimbirch, mikelutz, jnicola, b_sharpe: Example recipe isn't functional

(cherry picked from commit e9574d73)
parent 46919be3
No related branches found
No related tags found
17 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!103032838547 Fix punctuation rules for inline label suffix colon with CSS only,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback(),!9914Issue #3451136 by quietone, gapple, ghost of drupal past: Improve...,!9882Draft: Issue #3481777 In bulk_form ensure the triggering element is the bulk_form button,!9839Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9815Issue #3480025: There is no way to remove entity cache items,!9757Issue #3478869 Add "All" or overview links to parent links,!9752Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9749Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9678Issue #3465132 by catch, Spokje, nod_: Show test run time by class in run-tests.sh output,!9578Issue #3304746 by scott_euser, casey, smustgrave: BigPipe cannot handle (GET)...,!9449Issue #3344041: Allow textarea widgets to be used for text (formatted) fields
Pipeline #247612 canceled
{
"name": "drupal_recipe/example",
"description": "An example Drupal recipe description",
"type": "drupal-recipe",
"require": {
"drupal/core": "^10.0.x-dev"
},
"license": "GPL-2.0-or-later"
}
# The type key is similar to the package key in module.info.yml. It
# can be used by the UI to group Drupal recipes. Additionally,
# the type 'Site' means that the Drupal recipe will be listed in
# the installer.
type: 'Content type'
# The name of the recipe.
name: 'Example'
# The description of the recipe.
description: 'Provides an example recipe.'
# The type key is similar to the package key in module.info.yml. It can be used
# to group Drupal recipes.
type: 'Content type'
install:
# An array of modules or themes to install, if they are not already.
# The system will detect if it is a theme or a module. During the
# install only simple configuration from the new modules is created.
# This allows the Drupal recipe control over the configuration.
# An array of modules or themes to install if they are not already. The system
# will detect if it is a theme or a module. During the install only simple
# configuration from the new modules is created. This allows the Drupal recipe
# control over the configuration.
- node
- text
config:
# A Drupal recipe can have a config directory. All configuration
# is this directory will be imported after the modules have been
# installed.
# Additionally, the Drupal recipe can install configuration entities
# provided by the modules it configures. This allows them to not have
# to maintain or copy this configuration. Note the examples below are
# fictitious.
# A Drupal recipe can have a config directory. All configuration is this
# directory will be imported after the modules have been installed.
# Additionally, the Drupal recipe can install configuration entities provided
# by the modules it configures. This allows them to not have to maintain or
# copy this configuration.
import:
node:
- node.type.article
# Import all configuration that is provided by the text module and any
text:
- text.settings
# Import all configuration that is provided by the node module and any
# optional configuration that depends on the text module that is provided by
# modules already installed.
text: '*'
node: '*'
# Configuration actions may be defined. The structure here should be
# entity_type.ID.action. Below the user role entity type with an ID of
# editor is having the permissions added. The permissions key will be
# mapped to the \Drupal\user\Entity\Role::grantPermission() method.
actions:
user.role.editor:
createIfNotExists:
label: 'Editor'
grantPermissions:
- 'delete any article content'
- 'edit any article content'
content: {}
# A Drupal recipe can have a content directory. All content in this
# directory will be created after the configuration is installed.
text.settings:
simpleConfigUpdate:
default_summary_length: 700
# A Drupal recipe can have a content directory. All content in this directory
# will be created after the configuration is installed.
......@@ -7,6 +7,7 @@
use Drupal\Core\Recipe\Recipe;
use Drupal\Core\Recipe\RecipeFileException;
use Drupal\Core\Recipe\RecipePreExistingConfigException;
use Drupal\Core\Recipe\RecipeRunner;
use Drupal\KernelTests\KernelTestBase;
/**
......@@ -67,4 +68,16 @@ public function testPreExistingMatchingConfiguration(): void {
$this->assertSame('core/tests/fixtures/recipes/install_node_with_config/config', $recipe->config->recipeConfigDirectory);
}
public function testExampleRecipe(): void {
// The example recipe imports all the configurations from the node module
// including optional configurations associated with the search and view
// modules. So we have to install them before applying the example recipe.
$this->container->get('module_installer')->install(['search', 'views']);
// Apply the example recipe.
$recipe = Recipe::createFromDirectory('core/recipes/example');
RecipeRunner::processRecipe($recipe);
// Verify if the 'default_summary_length' value is updated.
$this->assertSame($this->config('text.settings')->get('default_summary_length'), 700);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment