function ConfigCase::testConfigList

8.0.x configTest.php ConfigCase::testConfigList()
7.x configTest.php ConfigCase::testConfigList()
master configTest.php ConfigCase::testConfigList()

File

tests/configTest.php, line 28

Namespace

Unish

Class

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

Code

function testConfigList() {
  $options = $this->options();
  $this->drush('config-list', array(), $options);
  $result = $this->getOutputAsList();
  $this->assertNotEmpty($result, 'An array of config names was returned.');
  $this->assertTrue(in_array('update.settings', $result), 'update.settings name found in the config names.');

  $this->drush('config-list', array('system'), $options);
  $result = $this->getOutputAsList();
  $this->assertTrue(in_array('system.site', $result), 'system.site found in list of config names with "system" prefix.');

  $this->drush('config-list', array('system'), $options + array('format' => 'json'));
  $result = $this->getOutputFromJSON();
  $this->assertNotEmpty($result, 'Valid, non-empty JSON output was returned.');
}