X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrush%2Fdrush%2Ftests%2FconfigTest.php;fp=vendor%2Fdrush%2Fdrush%2Ftests%2FconfigTest.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=77d9d075c18c39a2c14f093021704f9c399dd323;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/drush/drush/tests/configTest.php b/vendor/drush/drush/tests/configTest.php deleted file mode 100644 index 77d9d075c..000000000 --- a/vendor/drush/drush/tests/configTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestSkipped('Config only available on D8+.'); - } - - if (!$this->getSites()) { - $this->setUpDrupal(1, TRUE); - $this->drush('pm-enable', array('config'), $this->options()); - } - } - - function testConfigGetSet() { - $options = $this->options(); - $this->drush('config-set', array('system.site', 'name', 'config_test'), $options); - $this->drush('config-get', array('system.site', 'name'), $options); - $this->assertEquals("'system.site:name': config_test", $this->getOutput(), 'Config was successfully set and get.'); - } - - 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.'); - } - - function testConfigExportImport() { - $options = $this->options(); - // Get path to sync dir. - $this->drush('core-status', array('config-sync'), $options + array('format' => 'json')); - $sync = $this->webroot() . '/' . $this->getOutputFromJSON('config-sync'); - $system_site_yml = $sync . '/system.site.yml'; - $core_extension_yml = $sync . '/core.extension.yml'; - - // Test export - $this->drush('config-export', array(), $options); - $this->assertFileExists($system_site_yml); - - // Test import by finishing the round trip. - $contents = file_get_contents($system_site_yml); - $contents = preg_replace('/front: .*/', 'front: unish', $contents); - $contents = file_put_contents($system_site_yml, $contents); - $this->drush('config-import', array(), $options); - $this->drush('config-get', array('system.site', 'page'), $options + array('format' => 'json')); - $page = $this->getOutputFromJSON('system.site:page'); - $this->assertContains('unish', $page->front, 'Config was successfully imported.'); - - // Similar, but this time via --partial option. - $contents = file_get_contents($system_site_yml); - $contents = preg_replace('/front: .*/', 'front: unish partial', $contents); - $partial_path = UNISH_SANDBOX . '/partial'; - mkdir($partial_path); - $contents = file_put_contents($partial_path. '/system.site.yml', $contents); - $this->drush('config-import', array(), $options + array('partial' => NULL, 'source' => $partial_path)); - $this->drush('config-get', array('system.site', 'page'), $options + array('format' => 'json')); - $page = $this->getOutputFromJSON('system.site:page'); - $this->assertContains('unish partial', $page->front, '--partial was successfully imported.'); - } - - function options() { - return array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - ); - } -}