+ /**
+ * Rename various labels to not match the names.
+ *
+ * Doing these mimics the fact the name != the label in international installs & triggers failures in
+ * code that expects it to.
+ */
+ protected function renameLabels() {
+ $replacements = ['Pending', 'Refunded'];
+ foreach ($replacements as $name) {
+ CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET label = '{$name} Label**' where label = '{$name}' AND name = '{$name}'");
+ }
+ }
+
+ /**
+ * Undo any label renaming.
+ */
+ protected function resetLabels() {
+ CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET label = REPLACE(name, ' Label**', '') WHERE label LIKE '% Label**'");
+ }
+