Merge pull request #2687 from giant-rabbit/event_info_custom_validation
[civicrm-core.git] / tests / phpunit / WebTest / Import / CustomDataTest.php
index 9759c6e26e056c3cb1e6db5a9083c61f5c4c4a27..72fb6ba7ee9696e8772de78137657b8d1dfde807 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -24,7 +24,6 @@
  +--------------------------------------------------------------------+
 */
 
-
 require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
 class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
 
@@ -42,16 +41,12 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
     $firstName3 = 'Ma' . substr(sha1(rand()), 0, 4);
     $this->webtestAddContact($firstName3, "Anderson", TRUE);
     $sortName3 = "$firstName3 Anderson";
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $url1 = explode('&cid=', $this->getLocation());
-    $id1 = $url1[1];
+    $id1 = $this->urlArg('cid');
 
     $firstName4 = 'Ma' . substr(sha1(rand()), 0, 4);
     $this->webtestAddContact($firstName4, "Anderson", TRUE);
     $sortName4 = "$firstName4 Anderson";
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $url2 = explode('&cid=', $this->getLocation());
-    $id2 = $url2[1];
+    $id2 = $this->urlArg('cid');
 
     // Get sample import data.
     list($headers, $rows, $customDataVerify) = $this->_individualCustomCSVData($customGroupTitle, $firstName1, $firstName2,
@@ -143,7 +138,7 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
 
   function _addCustomData($customGroupTitle, $id1, $id2) {
 
-    $this->open($this->sboxPath . "civicrm/admin/custom/group?reset=1");
+    $this->openCiviPage("admin/custom/group", "reset=1");
 
     //add new custom data
     $this->click("//a[@id='newCustomDataGroup']/span");
@@ -196,7 +191,7 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent('newCustomField');
 
     $this->assertTrue($this->isTextPresent("Your custom field '{$dateFieldLabel}' has been saved."));
-    
+
     $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];