Score:1

Can you install exported site config as part of a kernel test?

cn flag

I am using the Configuration Sync module to export config specific to my site out into a config directory that lives outside my main Drupal directory.

When writing kernel tests I know that you can use $this->installConfig() and specify a module(s) to install default config from, but how can I specify certain (or all) config files from that directory to be installed inside of a kernel test?

Score:0
br flag

If you need to install some separately, determine which you would like to install together and place them in a new module together. Then you can install different combinations by specifying which modules to install.

Jimmyb_1991 avatar
cn flag
I agree that is definitely a way, but that seems contrary to how the config export works. It already gives me a directory full of config files. I feel I should be able to use something `$this->installConfig('config_sync') to install them during a test.
br flag
That’s like saying that you should be able to install a module, but specify which entities are installed, or which blocks. A module is a self contained collection of code that implements a feature. If you need only one part of that, then it is a dependency and should get split off into a separate module.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.