X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FContribute%2FOfflineContributionTest.php;h=3f49498757790b260d19abcfe9a405881fb9085c;hb=4f1f1f2a13f7d38ff984b04c7512617440bea5f8;hp=c0f6e655002e6ba67faf7f9233760910154005d2;hpb=9cc8b9b246a371b9621a8279545258073fbd0e48;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index c0f6e65500..3f49498757 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | + | CiviCRM version 4.6 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ @@ -36,7 +36,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneContributeAdd() { + public function testStandaloneContributeAdd() { $this->webtestLogin(); // Create a contact to be used as soft creditor @@ -46,7 +46,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { //financial account for check $this->openCiviPage("admin/options/payment_instrument", "reset=1"); - $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/div/table/tbody//tr/td[1][text()='Check']/../td[3]"); + $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1]/div[text()='Check']/../../td[3]"); // Add new Financial Account $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7); @@ -137,8 +137,6 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->type("invoice_id", time()); $this->webtestFillDate('thankyou_date'); - - //Premium section $this->click("Premium"); $this->waitForElementPresent("fulfilled_date"); @@ -199,14 +197,14 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { 4 => 'Donation', 2 => '50.00', 6 => 'Completed', - 1 => "{$firstName} {$lastName}" + 1 => "{$firstName} {$lastName}", ); foreach ($expected as $value => $label) { $this->verifyText("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[2]/td[$value]", preg_quote($label)); } } - function testDeductibleAmount() { + public function testDeductibleAmount() { $this->webtestLogin(); //add authorize .net payment processor @@ -310,19 +308,18 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->_verifyAmounts($checkScenario5); } - //common function for doing offline contribution /** - * @param $params - * @param $firstName - * @param $lastName + * common function for doing offline contribution + * @param array $params + * @param string $firstName + * @param string $lastName * @param $processorName */ - function _doOfflineContribution($params, $firstName, $lastName, $processorName) { + public function _doOfflineContribution($params, $firstName, $lastName, $processorName) { $this->waitForElementPresent("css=li#tab_contribute a"); $this->click("css=li#tab_contribute a"); $this->waitForElementPresent("link=Submit Credit Card Contribution"); - $this->clickLink("link=Submit Credit Card Contribution", "_qf_Contribution_cancel-bottom", FALSE); // since we don't have live credentials we will switch to test mode $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[2]@href"); @@ -367,11 +364,11 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("The contribution record has been processed."), "Status message didn't show up after saving!"); } - //common function for verifing total_amount, and non_deductible_amount /** + * common function for verifing total_amount, and non_deductible_amount * @param $verifyData */ - function _verifyAmounts($verifyData) { + public function _verifyAmounts($verifyData) { // since we are doing test contributions we need to search for test contribution and select first contribution // record for the contact $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); @@ -383,7 +380,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE); foreach ($verifyData as $label => $value) { - if ( $label == 'sort_name' ) { + if ($label == 'sort_name') { continue; } $this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", @@ -398,10 +395,10 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { "xpath=//form[@id='Basic']/div[3]/div[1]/div[2]/table/tbody/tr[1]/td[11]/span/a[text()='View']"); $this->clickLink("xpath=//form[@id='Basic']/div[3]/div[1]/div[2]/table/tbody/tr[1]/td[11]/span/a[text()='View']", - 'crm-contact-actions-link', FALSE); + 'crm-contact-actions-link', FALSE); } - function testOnlineContributionWithZeroAmount() { + public function testOnlineContributionWithZeroAmount() { $this->webtestLogin(); // Create a contact to be used as soft creditor @@ -432,7 +429,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { 'Financial Type' => 'Donation', 'Total Amount' => '0.00', 'Contribution Status' => 'Completed', - 'Paid By' => 'Credit Card' + 'Paid By' => 'Credit Card', ); $this->webtestVerifyTabularData($expected); }