You are here

settings.txt in Hook Update Deploy Tools 8

Same filename and directory in other branches
  1. 7 tests/settings.txt

A series of update hooks to test setting various types of drupal variables. For module developer testing only.

File

tests/settings.txt
View source
  1. /**
  2. * @file
  3. * A series of update hooks to test setting various types of drupal variables.
  4. * For module developer testing only.
  5. */
  6. /**
  7. * Settings initialize test.
  8. */
  9. function deploy_test_update_7015() {
  10. $msg = HookUpdateDeployTools\Settings::set('string_1_test', '1');
  11. $msg .= HookUpdateDeployTools\Settings::set('bool_true_test', TRUE);
  12. $msg .= HookUpdateDeployTools\Settings::set('int_1_test', 1);
  13. $msg .= HookUpdateDeployTools\Settings::set('string_string_test', 'wahoooo im free');
  14. $msg .= HookUpdateDeployTools\Settings::set('string_0_test', '0');
  15. $msg .= HookUpdateDeployTools\Settings::set('bool_false_test', FALSE);
  16. $msg .= HookUpdateDeployTools\Settings::set('int_0_test', 0);
  17. $msg .= HookUpdateDeployTools\Settings::set('fakebool_false_test', 'FALSE');
  18. $msg .= HookUpdateDeployTools\Settings::set('fakebool_true_test', 'TRUE');
  19. $new_array = array('thunder' => 1, 'lightning' => TRUE);
  20. $msg .= HookUpdateDeployTools\Settings::set('array_test', $new_array);
  21. $new_object = json_decode(json_encode($new_array), FALSE);
  22. $msg .= HookUpdateDeployTools\Settings::set('object_test', $new_object);
  23. return $msg;
  24. }
  25. /**
  26. * Settings alter with no actual change test (same as what is saved).
  27. */
  28. function deploy_test_update_7016() {
  29. $msg = HookUpdateDeployTools\Settings::set('string_1_test', '1');
  30. $msg .= HookUpdateDeployTools\Settings::set('bool_true_test', TRUE);
  31. $msg .= HookUpdateDeployTools\Settings::set('int_1_test', 1);
  32. $msg .= HookUpdateDeployTools\Settings::set('string_string_test', 'wahoooo im free');
  33. $msg .= HookUpdateDeployTools\Settings::set('string_0_test', '0');
  34. $msg .= HookUpdateDeployTools\Settings::set('bool_false_test', FALSE);
  35. $msg .= HookUpdateDeployTools\Settings::set('int_0_test', 0);
  36. $msg .= HookUpdateDeployTools\Settings::set('fakebool_false_test', 'FALSE');
  37. $msg .= HookUpdateDeployTools\Settings::set('fakebool_true_test', 'TRUE');
  38. $new_array = array('thunder' => 1, 'lightning' => TRUE);
  39. $msg .= HookUpdateDeployTools\Settings::set('array_test', $new_array);
  40. $new_object = json_decode(json_encode($new_array), FALSE);
  41. $msg .= HookUpdateDeployTools\Settings::set('object_test', $new_object);
  42. return $msg;
  43. }
  44. /**
  45. * Settings alter without any change of type (only values changed) test.
  46. */
  47. function deploy_test_update_7017() {
  48. $msg = HookUpdateDeployTools\Settings::set('string_1_test', '0');
  49. $msg .= HookUpdateDeployTools\Settings::set('bool_true_test', FALSE);
  50. $msg .= HookUpdateDeployTools\Settings::set('int_1_test', 0);
  51. $msg .= HookUpdateDeployTools\Settings::set('string_string_test', "I've changed");
  52. $msg .= HookUpdateDeployTools\Settings::set('string_0_test', '1');
  53. $msg .= HookUpdateDeployTools\Settings::set('bool_false_test', TRUE);
  54. $msg .= HookUpdateDeployTools\Settings::set('int_0_test', 1);
  55. $msg .= HookUpdateDeployTools\Settings::set('fakebool_false_test', 'TRUE');
  56. $msg .= HookUpdateDeployTools\Settings::set('fakebool_true_test', 'FALSE');
  57. $new_array = array('thunder' => 0, 'lightning' => FALSE);
  58. $msg .= HookUpdateDeployTools\Settings::set('array_test', $new_array);
  59. $new_object = json_decode(json_encode($new_array), FALSE);
  60. $msg .= HookUpdateDeployTools\Settings::set('object_test', $new_object);
  61. return $msg;
  62. }
  63. /**
  64. * Settings alter with type change test.
  65. */
  66. function deploy_test_update_7018() {
  67. $msg = HookUpdateDeployTools\Settings::set('string_1_test', 1);
  68. $msg .= HookUpdateDeployTools\Settings::set('bool_true_test', TRUE);
  69. $msg .= HookUpdateDeployTools\Settings::set('int_1_test', '1');
  70. $msg .= HookUpdateDeployTools\Settings::set('string_string_test', 25);
  71. $msg .= HookUpdateDeployTools\Settings::set('string_0_test', 0);
  72. $msg .= HookUpdateDeployTools\Settings::set('bool_false_test', 'FALSE');
  73. $msg .= HookUpdateDeployTools\Settings::set('int_0_test', '1');
  74. $msg .= HookUpdateDeployTools\Settings::set('fakebool_false_test', TRUE);
  75. $msg .= HookUpdateDeployTools\Settings::set('fakebool_true_test', FALSE);
  76. $new_array = array('thunder' => 0, 'lightning' => FALSE);
  77. $new_object = json_decode(json_encode($new_array), FALSE);
  78. $msg .= HookUpdateDeployTools\Settings::set('array_test', $new_object);
  79. $msg .= HookUpdateDeployTools\Settings::set('object_test', $new_array);
  80. return $msg;
  81. }
  82. /**
  83. * Delete all the settings for re-running the tests.
  84. */
  85. function deploy_test_update_7019() {
  86. variable_del('string_1_test');
  87. variable_del('bool_true_test');
  88. variable_del('int_1_test');
  89. variable_del('string_string_test');
  90. variable_del('string_0_test');
  91. variable_del('bool_false_test');
  92. variable_del('int_0_test');
  93. variable_del('fakebool_false_test');
  94. variable_del('fakebool_true_test');
  95. variable_del('array_test');
  96. variable_del('object_test');
  97. $msg = "Deleted all the vars from these tests.";
  98. return $msg;
  99. }