public function ConfigCase::testConfigEdit

8.0.x configTest.php public ConfigCase::testConfigEdit()
7.x configTest.php public ConfigCase::testConfigEdit()

Tests editing config from a file (not interactively).

File

tests/configTest.php, line 68

Namespace

Unish

Class

ConfigCase
Tests for Configuration Management commands for D8+. @group commands

Code

public function testConfigEdit() {
  // Write out edits to a file.
  $config = "name: 'TEST NAME'\nmail: test@testmail.example.org";
  $path = UNISH_SANDBOX . '/system.site.yml';
  file_put_contents($path, $config);

  $options = $this->options();
  $options += array(
    'file' => $path,
    'yes' => NULL,
  );
  $this->drush('config-edit', array(), $options);
  $this->drush('config-get', array('system.site'), $this->options());
  $this->assertEquals($config, $this->getOutput());
}