siteAliasUnitTest.php

  1. 8.0.x tests/siteAliasUnitTest.php
  2. 6.x tests/siteAliasUnitTest.php
  3. 7.x tests/siteAliasUnitTest.php
  4. 5.x tests/siteAliasUnitTest.php
  5. master tests/siteAliasUnitTest.php

Namespace

Unish

Classes

Namesort descending Description
saUnitCase Unit tests for sitealias.inc

File

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