コード例 #1
0
    /**
     * Try to write a tiny drushrc.php to each place that drush checks. Also
     * write a sites/dev/aliases.drushrc.php file to the sandbox.
     */
    function setUp()
    {
        parent::setUp();
        $this->setUpDrupal();
        $this->setUpPaths();
        // These files are only written to sandbox so get automatically cleaned up.
        foreach ($this->paths as $key => $path) {
            $contents = <<<EOD
<?php
// Written by Drush's contextCase::setUp(). This file is safe to delete.

\$options['contextConfig'] = '{$key}';
\$command_specific['unit-eval']['contextConfig'] = '{$key}-specific';

EOD;
            $path .= $key == 'user' ? '/.drushrc.php' : '/drushrc.php';
            if (file_put_contents($path, $contents)) {
                $this->written[] = $this->convert_path($path);
            }
        }
        // Also write a site alias so we can test its supremacy in context hierarchy.
        $path = $this->site . '/aliases.drushrc.php';
        $aliases['contextAlias'] = array('contextConfig' => 'alias1', 'command-specific' => array('unit-eval' => array('contextConfig' => 'alias-specific')));
        $contents = unish_file_aliases($aliases);
        $return = file_put_contents($path, $contents);
    }
コード例 #2
0
 /**
  * Try to write a tiny drushrc.php to each place that drush checks. Also
  * write a sites/dev/aliases.drushrc.php file to the sandbox.
  */
 function setUp()
 {
     parent::setUp();
     $path = UNISH_SANDBOX . '/aliases.drushrc.php';
     $aliases['site1'] = array('root' => UNISH_SANDBOX, 'uri' => 'site1.com', 'source-command-specific' => array('core-rsync' => array('exclude-paths' => 'excluded_by_source')), 'target-command-specific' => array('core-rsync' => array('exclude-paths' => 'excluded_by_target')), 'path-aliases' => array('%files' => 'sites/default/files'));
     $contents = $this->file_aliases($aliases);
     $return = file_put_contents($path, $contents);
 }