4 use Webmozart\PathUtil\Path;
7 * Tests for config-pull command. Sets up two Drupal sites.
12 class ConfigPullCase extends CommandUnishTestCase
15 public function setUp()
17 $this->setUpDrupal(2, true);
21 * Make sure a change propagates using config-pull+config-import.
23 public function testConfigPull()
25 $aliases = $this->getAliases();
26 $source = $aliases['stage'];
27 $destination = $aliases['dev'];
29 $this->drush('config-get', ['system.site', 'uuid'], ['yes' => null], $source);
30 list($name, $uuid) = explode(' ', $this->getOutput());
31 $this->drush('config-set', ['system.site', 'uuid', $uuid], ['yes' => null], $destination);
33 $this->drush('config-set', ['system.site', 'name', 'testConfigPull'], ['yes' => null], $source);
34 $this->drush('config-pull', [$source, $destination]);
35 $this->drush('config-import', [], ['yes' => null], $destination);
36 $this->drush('config-get', ['system.site', 'name'], [], $source);
37 $this->assertEquals("'system.site:name': testConfigPull", $this->getOutput(), 'Config was successfully pulled.');
39 // Test that custom target dir works
40 $target = Path::join($this->getSandbox(), __CLASS__);
41 $this->mkdir($target);
42 $this->drush('config-pull', [$source, "$destination:$target"]);
43 $this->assertFileExists(Path::join($target, 'system.site.yml'));