CRM-12556 - Set admin API key for new test sites
authorTim Otten <totten@civicrm.org>
Sat, 11 May 2013 00:39:44 +0000 (20:39 -0400)
committerTim Otten <totten@civicrm.org>
Sat, 11 May 2013 00:39:44 +0000 (20:39 -0400)
----------------------------------------
* CRM-12556: Assign api_key for a user via command-line
  http://issues.civicrm.org/jira/browse/CRM-12556

tools/scripts/mk-drupal-test-site

index c73b4401894e0a11fc9ea97a4f4735b043989cf8..ae4a830bc5120ba6b9194478dd1850a59e5cd05c 100755 (executable)
@@ -124,6 +124,8 @@ class CiviSeleniumSettings {
        var \$password = 'demo';
        var \$adminUsername = '${ADMIN_USER}';
        var \$adminPassword = '${ADMIN_PASS}';
+       var \$adminApiKey = 'apikey${ADMIN_PASS}';
+       var \$siteKey = '${SITE_KEY}';
         var \$UFemail = 'noreply@civicrm.org';
        function __construct() {
                \$this->fullSandboxPath = \$this->sandboxURL . \$this->sandboxPATH;
@@ -141,4 +143,5 @@ drush -l "${SITE_URL}" -y pm-enable civicrm
 drush -l "${SITE_URL}" -y pm-enable civicrm_webtest
 drush -l "${SITE_URL}" -y user-create --password=demo --mail='demo@example.com' demo
 drush -l "${SITE_URL}" -y user-add-role civicrm_webtest_user demo
+drush -l "${SITE_URL}" -y -u "$ADMIN_USER" civicrm-api contact.create id=user_contact_id api_key="apikey$ADMIN_PASS"
 popd