magento2: CLI command missing `config:delete`

Description (*)

The same way that we have config:set for setting configuration value globally or for a specific value, we should have option to remove the configuration value with config:delete with the same set of flags that config:set has.

Expected behaviour (*)

The result of such action would be Use system value where applicable or rolling back the default value provided in config.xml by default.

Benefits

For me, it’s useful for Functional Tests, as we run some environmental configurations during tests, and then I’d love to have the possibility of rolling back settings to defaults.

Additional information

CC: @dmytro-ch

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 17 (14 by maintainers)

Most upvoted comments

@lbajsarowicz thank you for the report! I’m working on this issue.

Hi @lbajsarowicz I like this feature, should simplify test creation and help with test isolation issues.

I would prefer to have command called config:use-default to align it what see on the Config Page. Should be more obvious then reset or delete.

The other thing I think would be helpful to have command config:get path/to/config which will return value which is set right now. It should help writing tests for customized Magento stores. Basically you’ll be able to do following:

  1. Run <magentoCli command="config:get path/to/config" stepKey="currentConfig" />
  2. Do whatever you want in your test.
  3. In after block just set everything back <magentoCli command="config:set path/to/config {$currentConfig}" stepKey="rollbackConfig" />