Security update for permissions_by_term
[yaffs-website] / vendor / drush / drush / tests / siteAliasUnitTest.php
1 <?php
2
3 namespace Unish;
4
5 /**
6   * Unit tests for sitealias.inc
7   *
8   * @group base
9   */
10 class saUnitCase extends UnitUnishTestCase {
11
12   /**
13    * Tests _sitealias_array_merge().
14    *
15    * @see _sitealias_array_merge().
16    */
17   public function testArrayMerge() {
18     // Original site alias.
19     $site_alias_a = array(
20       'remote-host' => 'fake.remote-host.com',
21       'remote-user' => 'www-admin',
22       'root' => '/fake/path/to/root',
23       'uri' => 'default',
24       'command-specific' => array(
25         'rsync' => array(
26           'delete' => TRUE,
27         ),
28       ),
29     );
30     // Site alias which overrides some settings from $site_alias_a.
31     $site_alias_b = array(
32       'remote-host' => 'another-fake.remote-host.com',
33       'remote-user' => 'www-other',
34       'root' => '/fake/path/to/root',
35       'uri' => 'default',
36       'command-specific' => array(
37         'rsync' => array(
38           'delete' => FALSE,
39         ),
40       ),
41     );
42     // Expected result from merging $site_alias_a and $site_alias_b.
43     $site_alias_expected = array(
44       'remote-host' => 'another-fake.remote-host.com',
45       'remote-user' => 'www-other',
46       'root' => '/fake/path/to/root',
47       'uri' => 'default',
48       'command-specific' => array(
49         'rsync' => array(
50           'delete' => FALSE,
51         ),
52       ),
53     );
54
55     $site_alias_result = _sitealias_array_merge($site_alias_a, $site_alias_b);
56     $this->assertEquals($site_alias_expected, $site_alias_result);
57   }
58 }