function UnishTestCase::unish_file_aliases

8.0.x UnishTestCase.php UnishTestCase::unish_file_aliases($aliases)
7.x UnishTestCase.php UnishTestCase::unish_file_aliases($aliases)
master UnishTestCase.php UnishTestCase::unish_file_aliases($aliases)

Prepare the contents of an aliases file.

4 calls to UnishTestCase::unish_file_aliases()
commandSpecificCase::setUp in tests/commandSpecificTest.php
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.
contextCase::setUp in tests/contextTest.php
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.
shellAliasesCase::setUp in tests/shellAliasTest.php
Write a config file that contains the shell-aliases array.
UnishTestCase::writeSiteAlias in tests/Unish/UnishTestCase.php

File

tests/Unish/UnishTestCase.php, line 371

Namespace

Unish

Class

UnishTestCase

Code

function unish_file_aliases($aliases) {
  foreach ($aliases as $name => $alias) {
    $records[] = sprintf('$aliases[\'%s\'] = %s;', $name, var_export($alias, TRUE));
  }
  $contents = "<?php\n\n" . implode("\n\n", $records);
  return $contents;
}