parent::setUp();
}
- function testAuthenticatedMultipleEvent(){
+ function testAuthenticatedMultipleEvent() {
// Log in using webtestLogin() method
$this->webtestLogin();
$value = $this->_testCheckOut();
//three event names
- $events = array( 1 => $eventTitle1,
- 2 => $eventTitle2,
- 3 => $eventTitle3,
- );
+ $events = array(
+ 1 => $eventTitle1,
+ 2 => $eventTitle2,
+ 3 => $eventTitle3,
+ );
//check the existence of the contacts who were registered and the one who did the contribution
- $this->_checkContributionsandEventRegistration($value[0],$value[1],$events);
+ $this->_checkContributionsandEventRegistration($value[0], $value[1], $events);
}
- function testAnonymousMultipleEvent(){
- // This is the path where our testing install resides.
+ function testAnonymousMultipleEvent() {
+ // This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
$this->openCiviPage("dashboard", "reset=1");
//three event names
- $events = array( 1 => $eventTitle1,
- 2 => $eventTitle2,
- 3 => $eventTitle3,
- );
+ $events = array(
+ 1 => $eventTitle1,
+ 2 => $eventTitle2,
+ 3 => $eventTitle3,
+ );
//check the existence of the contacts who were registered and the one who did the contribution
- $this->_checkContributionsandEventRegistration($value[0],$value[1],$events);
+ $this->_checkContributionsandEventRegistration($value[0], $value[1], $events);
}
function _testAddEventInfo($eventTitle, $eventDescription) {
$this->waitForElementPresent("_qf_Fee_upload-bottom");
$this->click("CIVICRM_QFID_1_is_monetary");
$this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
- $this->select('financial_type_id','Event Fee');
+ $this->select('financial_type_id', 'Event Fee');
if ($priceSet) {
// get one - TBD
}
$this->webtestFillDate("discount_start_date_1", "-1 week");
$this->webtestFillDate("discount_end_date_1", "+2 week");
$this->clickLink("_qf_Fee_submit", "discounted_value_2_1");
- $this->type("discounted_value_1_1","225.00");
- $this->type("discounted_value_2_1","300.00");
+ $this->type("discounted_value_1_1", "225.00");
+ $this->type("discounted_value_2_1", "300.00");
$this->click("xpath=//fieldset[@id='discount']/fieldset/table/tbody/tr[2]/td[3]/input");
}
$this->waitForPageToLoad($this->getTimeoutMsec());
}
- function _testCheckOut(){
+ function _testCheckOut() {
//View the Cart
$this->click("xpath=//div[@id='messages']/div/div/a[text()='View your cart.']");
$this->click("xpath=//a[@class='button crm-check-out-button']/span");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $firstName = "AB".substr(sha1(rand()), 0, 7);
- $lastName = "XY".substr(sha1(rand()), 0, 7);
- for( $i = 1; $i <= 3; $i++ ){
- $this->type("xpath=//form[@id='ParticipantsAndPrices']/fieldset[$i]/div/fieldset/div/div/fieldset/div/div[2]/input","{$firstName}.{$lastName}@home.com");
- $this->type("xpath=//form[@id='ParticipantsAndPrices']/fieldset[$i]/div/fieldset/div/div[2]/div[2]/input","{$firstName}.{$lastName}@example.com");
+ $firstName = "AB" . substr(sha1(rand()), 0, 7);
+ $lastName = "XY" . substr(sha1(rand()), 0, 7);
+ for ($i = 1; $i <= 3; $i++) {
+ $this->type("xpath=//form[@id='ParticipantsAndPrices']/fieldset[$i]/div/fieldset/div/div/fieldset/div/div[2]/input", "{$firstName}.{$lastName}@home.com");
+ $this->type("xpath=//form[@id='ParticipantsAndPrices']/fieldset[$i]/div/fieldset/div/div[2]/div[2]/input", "{$firstName}.{$lastName}@example.com");
$this->click("xpath=//form[@id='ParticipantsAndPrices']/fieldset[$i]/div[2]/div[2]/input[2]");
}
$this->click("_qf_ParticipantsAndPrices_upload-bottom");
return array($firstName, $lastName);
}
- function _checkContributionsandEventRegistration($firstName,$lastName,$events){
+ function _checkContributionsandEventRegistration($firstName, $lastName, $events) {
//Type the registered participant's email in autocomplete.
$this->click('sort_name_navigation');
- $this->type('css=input#sort_name_navigation',"{$firstName}.{$lastName}@home.com" );
+ $this->type('css=input#sort_name_navigation', "{$firstName}.{$lastName}@home.com");
$this->typeKeys('css=input#sort_name_navigation', "{$firstName}.{$lastName}@home.com");
// Wait for result list.
//click on Events Tab
$this->click("xpath=//li[@id='tab_participant']/a");
//check if the participant is registered for all the three events
- foreach($events as $key => $value){
+ foreach ($events as $key => $value) {
$this->waitForElementPresent("link=$value");
$this->assertTrue($this->isElementPresent("link=$value"));
}
- for( $i = 1; $i <= 3; $i++ ){
+ for ($i = 1; $i <= 3; $i++) {
$this->waitForElementPresent("xpath=//table[@class='selector']/tbody/tr[$i]/td[6][text()='Registered']");
$this->assertTrue($this->isElementPresent("xpath=//table[@class='selector']/tbody/tr[$i]/td[6][text()='Registered']"));
}
//Type the billing email in autocomplete.
$this->click('sort_name_navigation');
- $this->type('css=input#sort_name_navigation',"{$firstName}.{$lastName}@example.com" );
+ $this->type('css=input#sort_name_navigation', "{$firstName}.{$lastName}@example.com");
$this->typeKeys('css=input#sort_name_navigation', "{$firstName}.{$lastName}@example.com");
// Wait for result list.
//click on Contributions Tab
$this->click("xpath=//li[@id='tab_contribute']/a");
//check for the three contributions
- foreach($events as $key => $value){
+ foreach ($events as $key => $value) {
$this->waitForElementPresent("xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'$value')]");
$this->assertTrue($this->isElementPresent("xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'$value')]"));
}