<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
parent::setUp();
}
- function testCreateEventRegisterPage() {
+ public function testCreateEventRegisterPage() {
// Log in using webtestLogin() method
$this->webtestLogin();
$email1 = $firstName . "@test.com";
$email2 = $participantfname . "@test.com";
- // We need a payment processor
- $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
+ // Use default payment processor
+ $processorName = 'Test Processor';
$this->webtestAddPaymentProcessor($processorName);
//add email to name and address profile
$this->waitForPageToLoad($this->getTimeoutMsec());
}
- function testAnoumyousRegisterPage() {
+ public function testAnoumyousRegisterPage() {
// add the required Drupal permission
$permission = array('edit-1-access-all-custom-data');
$this->changePermissions($permission);
$email3 = $participantfname2 . "@test.com";
$email4 = $firstName2 . "@test.com";
- // We need a payment processor
- $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
+ // Use default payment processor
+ $processorName = 'Test Processor';
$this->webtestAddPaymentProcessor($processorName);
//add email field to name and address profile
*
* @return array
*/
- function _testGetCustomFieldId($customGrpId1) {
+ public function _testGetCustomFieldId($customGrpId1) {
$customId = array();
// Create a custom data to add in profile
}
/**
- * @param $eventPageId
+ * @param int $eventPageId
*/
- function _testRemoveProfile($eventPageId) {
+ public function _testRemoveProfile($eventPageId) {
$this->openCiviPage("event/manage/settings", "reset=1&action=update&id=$eventPageId");
// Go to Online Contribution tab
}
/**
- * @param $customId
+ * @param int $customId
*
* @return array
*/
- function _testGetProfileId($customId) {
+ public function _testGetProfileId($customId) {
// create profiles
$profileId = array();
$profilefield = array(
*
* @return null
*/
- function _testCreateProfile($profilefield, $location = 0, $type) {
+ public function _testCreateProfile($profilefield, $location = 0, $type) {
$locationfields = array(
'supplemental_address_1',
'supplemental_address_2',
* @param $eventTitle
* @param $eventDescription
*/
- function _testAddEventInfo($eventTitle, $eventDescription) {
+ public function _testAddEventInfo($eventTitle, $eventDescription) {
$this->waitForElementPresent("_qf_EventInfo_upload-bottom");
$this->select("event_type_id", "value=1");
/**
* @param $streetAddress
*/
- function _testAddLocation($streetAddress) {
+ public function _testAddLocation($streetAddress) {
// Wait for Location tab form to load
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Location_upload-bottom");
//$streetAddress = "100 Main Street";
$this->type("address_1_street_address", $streetAddress);
$this->type("address_1_city", "San Francisco");
+ $this->waitForElementPresent('address_1_country_id');
+ $this->select("address_1_country_id", "value=1228");
$this->type("address_1_postal_code", "94117");
$this->select("address_1_state_province_id", "value=1004");
$this->type("email_1_email", "info@civicrm.org");
// Wait for "saved" status msg
$this->waitForElementPresent("_qf_Location_upload-bottom");
- $this->waitForTextPresent("'Event Location' information has been saved.");
+ $this->waitForText('crm-notification-container', "'Event Location' information has been saved.");
}
/**
* @param bool $priceSet
* @param string $processorName
*/
- function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") {
+ public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") {
// Go to Fees tab
$this->click("link=Fees");
$this->waitForElementPresent("_qf_Fee_upload-bottom");
}
/**
- * @param $profileId
+ * @param int $profileId
*
* @return null
*/
- function _testAddMultipleProfile($profileId) {
+ public function _testAddMultipleProfile($profileId) {
// Go to Online Contribution tab
$this->click("link=Online Registration");
$this->waitForElementPresent("_qf_Registration_upload-bottom");
}
/**
- * @param $eventPageId
- * @param $customId
- * @param $firstName
- * @param $lastName
- * @param $participantfname
- * @param $participantlname
+ * @param int $eventPageId
+ * @param int $customId
+ * @param string $firstName
+ * @param string $lastName
+ * @param string $participantfname
+ * @param string $participantlname
* @param $email1
* @param $email2
*/
$this->type("current_employer", "ABCD");
$this->type("job_title", "Painter");
+ $this->waitForElementPresent('nick_name');
$this->type("nick_name", "Nick");
$this->type("url-1", "http://www.test.com");
+ $this->waitForElementPresent('street_address-Primary');
$this->type("street_address-Primary", "Primary street address");
$this->type("city-Primary", "primecity");
$this->type("phone-Primary-1", "98667764");
$this->type("middle_name", "xyz");
$this->click("name=gender_id value=2");
+ $this->waitForElementPresent('participant_role');
$this->select("participant_role", "value=2");
$this->click("_qf_Register_upload-bottom");
$this->type("custom_" . $customId[1], "participant_custom1");
$this->type("custom_" . $customId[2], "participant_custom1");
+ $this->waitForElementPresent('street_address-Primary');
$this->type("street_address-Primary", "Primary street address");
$this->type("city-Primary", "primecity");
$this->type("phone-Primary-1", "98667764");
}
/**
- * @param $eventPageId
- * @param $customId
- * @param $firstName2
- * @param $lastName2
- * @param $participantfname2
+ * @param int $eventPageId
+ * @param int $customId
+ * @param string $firstName2
+ * @param string $lastName2
+ * @param string $participantfname2
* @param $participantlname2
* @param $email3
* @param $email4
*/
- function _testEventRegistrationAfterRemoving($eventPageId, $customId, $firstName2, $lastName2, $participantfname2, $participantlname2, $email3, $email4) {
+ public function _testEventRegistrationAfterRemoving($eventPageId, $customId, $firstName2, $lastName2, $participantfname2, $participantlname2, $email3, $email4) {
$this->openCiviPage("event/register", "id={$eventPageId}&reset=1", "_qf_Register_upload-bottom");
$this->select("additional_participants", "value=1");
/**
* @return array|string
*/
- function _addEmailField() {
+ public function _addEmailField() {
//add email field in name and address profile
$this->openCiviPage('admin/uf/group/field/add', 'reset=1&action=add&gid=1', "_qf_Field_next-bottom");
$this->select("field_name[0]", "value=Contact");
}
/**
- * @param $cfId
+ * @param int $cfId
*/
- function _removeEmailField($cfId) {
+ public function _removeEmailField($cfId) {
$this->openCiviPage("admin/uf/group/field", "action=delete&id={$cfId}");
$this->click("_qf_Field_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());