<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
parent::setUp();
}
- function testContactContextAdd() {
+ public function testContactContextAdd() {
// Log in using webtestLogin() method
$this->webtestLogin();
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
// Add new Financial Account
- $orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
- $financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
+ $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7);
+ $financialAccountTitle = 'Financial Account ' . substr(sha1(rand()), 0, 4);
$financialAccountDescription = "{$financialAccountTitle} Description";
$accountingCode = 1033;
$financialAccountType = 'Asset';
$isDefault = FALSE;
//Add new organisation
- if($orgName) {
+ if ($orgName) {
$this->webtestAddOrganization($orgName);
}
$this->_testAddFinancialAccount($financialAccountTitle,
$isDefault
);
- $this->webtestAddContact($firstName, "Anderson", true);
+ $this->webtestAddContact($firstName, "Anderson", TRUE);
// Get the contact id of the new contact
$contactUrl = $this->parseURL();
$this->type("invoice_id", time());
$this->webtestFillDate('thankyou_date');
-
//Premium section
$this->click("Premium");
$this->waitForElementPresent("fulfilled_date");
$this->webtestFillDate('fulfilled_date');
// Clicking save.
- $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer');
+ $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer', FALSE);
// Is status message correct?
$this->waitForText('crm-notification-container', "The contribution record has been saved");
$this->waitForElementPresent("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']");
+ $viewUrl = $this->parseURL($this->getAttribute("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']@href"));
+ $id = $viewUrl['queryString']['id'];
+ $this->assertType('numeric', $id);
// click through to the Contribution view screen
$this->click("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']");
}
// check values of contribution record in the DB
- $viewUrl = $this->parseURL();
- $id = $viewUrl['queryString']['id'];
- $this->assertType('numeric', $id);
$searchParams = array('id' => $id);
$compareParams = array(
$this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compareParams);
// go to soft creditor contact view page
- $this->click("css=table.crm-soft-credit-listing tbody tr td a");
+ $this->clickLink("css=table.crm-soft-credit-listing tbody tr td a");
// go to contribution tab
$this->waitForElementPresent("css=li#tab_contribute a");
1 => "{$firstName} Anderson",
);
foreach ($expected as $value => $label) {
- $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", preg_quote($label));
+ $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody//tr/td[$value]", preg_quote($label));
}
}
}
-