<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
parent::setUp();
}
- function testCustomDataImport() {
+ public function testCustomDataImport() {
$this->webtestLogin();
$firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7);
}
}
- /*
- * Helper function to provide data for custom data import.
- */
/**
+ * Helper function to provide data for custom data import.
+ *
* @param $customGroupTitle
- * @param $firstName1
- * @param $firstName2
+ * @param string $firstName1
+ * @param string $firstName2
* @param $id1
* @param $id2
*
* @return array
*/
- function _individualCustomCSVData($customGroupTitle, $firstName1, $firstName2, $id1, $id2) {
+ public function _individualCustomCSVData($customGroupTitle, $firstName1, $firstName2, $id1, $id2) {
list($customDataParams, $customDataVerify) = $this->_addCustomData($customGroupTitle, $id1, $id2);
$headers = array(
*
* @return array
*/
- function _addCustomData($customGroupTitle, $id1, $id2) {
+ public function _addCustomData($customGroupTitle, $id1, $id2) {
$this->openCiviPage("admin/custom/group", "reset=1");
$this->click("extends[0]");
$this->select("extends[0]", "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
+ $this->clickLink('_qf_Group_next-bottom');
//Is custom group created?
$this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
+ $this->waitForElementPresent('_qf_Field_cancel-bottom');
$url = explode('gid=', $this->getLocation());
$gid = $url[1];
$this->click("is_searchable");
// clicking save
- $this->click('_qf_Field_next-bottom');
+ $this->click('_qf_Field_done-bottom');
$this->waitForElementPresent('newCustomField');
- $this->assertTrue($this->isTextPresent("Custom field '{$dateFieldLabel}' has been saved."));
+ $this->waitForText('crm-notification-container', "Custom field '{$dateFieldLabel}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$dateFieldLabel']");
$dateFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$dateFieldLabel']/../../td[8]/span/a@href"));
$dateFieldId = $dateFieldId[1];
$this->click("is_searchable");
//clicking save
- $this->click("_qf_Field_next");
+ $this->click("_qf_Field_done");
$this->waitForElementPresent('newCustomField');
//Is custom field created
$this->click("is_searchable");
// clicking save
- $this->click('_qf_Field_next-bottom');
+ $this->click('_qf_Field_done-bottom');
$this->waitForElementPresent('newCustomField');
$this->waitForText("crm-notification-container", "Custom field '{$multiSelectLabel}' has been saved.");
$this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$multiSelectLabel']/parent::td/parent::tr/");
$this->click("is_searchable");
// clicking save
- $this->click('_qf_Field_next-bottom');
+ $this->click('_qf_Field_done-bottom');
$this->waitForElementPresent('newCustomField');
$this->waitForText("crm-notification-container", "Custom field '{$contactReferenceLabel}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$contactReferenceLabel']/parent::td/parent::tr/");
$contactReferenceFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$contactReferenceLabel']/parent::td/parent::tr/td[8]/span/a@href"));
$contactReferenceFieldId = $contactReferenceFieldId[1];
$customDataParams = array(
- 'headers' =>
- array(
+ 'headers' => array(
"custom_{$dateFieldId}" => "$dateFieldLabel :: $customGroupTitle",
"custom_{$radioFieldId}" => "$radioFieldLabel :: $customGroupTitle",
"custom_{$multiSelectFieldId}" => "$multiSelectLabel :: $customGroupTitle",
"custom_{$contactReferenceFieldId}" => "$contactReferenceLabel :: $customGroupTitle",
),
- 'rows' =>
- array(0 => array("custom_{$dateFieldId}" => date('Y-m-d'),
+ 'rows' => array(
+ 0 => array(
+ "custom_{$dateFieldId}" => date('Y-m-d'),
"custom_{$radioFieldId}" => '2',
"custom_{$multiSelectFieldId}" => '3',
"custom_{$contactReferenceFieldId}" => $id1,
),
- 1 => array("custom_{$dateFieldId}" => date('Y-m-d', mktime(0, 0, 0, 4, 5, date('Y'))),
+ 1 => array(
+ "custom_{$dateFieldId}" => date('Y-m-d', mktime(0, 0, 0, 4, 5, date('Y'))),
"custom_{$radioFieldId}" => '1',
"custom_{$multiSelectFieldId}" => '2',
"custom_{$contactReferenceFieldId}" => $id2,
return array($customDataParams, $customDataVerify);
}
}
-