X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FContribute%2FOnBehalfOfOrganization.php;h=6ee756dbdd89c327e270a2b6d6aad1ef4e6030c0;hb=6f2500ee7589360102875df4367568fe87485df6;hp=b075524c38c907a6bcc623d787876755ae5a6457;hpb=39de6fd54b9843705d13cb9f70fbcc6296103670;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index b075524c38..6ee756dbdd 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -35,7 +35,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { parent::setUp(); } - function testOnBehalfOfOrganization() { + public function testOnBehalfOfOrganization() { $this->webtestLogin(); // create new individual @@ -111,7 +111,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->_testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle); } - function testOnBehalfOfOrganizationWithMembershipData() { + public function testOnBehalfOfOrganizationWithMembershipData() { $this->webtestLogin(); // create new individual @@ -236,14 +236,14 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->click("link=Add Field"); $this->waitForElementPresent('_qf_Field_next-bottom'); $this->select('field_name[0]', 'value=Membership'); - $label = $checkboxFieldLabel.' :: '. $customGroupTitle; + $label = $checkboxFieldLabel . ' :: ' . $customGroupTitle; $this->select('field_name[1]', "label=$label"); $this->click('field_name[1]'); $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->select('field_name[0]', 'value=Membership'); - $label = $radioFieldLabel.' :: '. $customGroupTitle; + $label = $radioFieldLabel . ' :: ' . $customGroupTitle; $this->select('field_name[1]', "label=$label"); $this->click('field_name[1]'); $this->click('_qf_Field_next-bottom'); @@ -251,8 +251,8 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("Your CiviCRM Profile Field '{$radioFieldLabel}' has been saved to 'On Behalf Of Organization'.")); //create organisation - $orgName = "Org WebAccess ". substr(sha1(rand()), 0, 7); - $orgEmail = "org". substr(sha1(rand()), 0, 7) . "@web.com"; + $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7); + $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com"; $this->webtestAddOrganization($orgName, $orgEmail); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -442,7 +442,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->webtestLogout(); } - function testOnBehalfOfOrganizationWithOrgData() { + public function testOnBehalfOfOrganizationWithOrgData() { $this->webtestLogin(); $this->openCiviPage("profile/edit", "reset=1&gid=4"); @@ -482,8 +482,8 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //create organisation - $orgName = "Org WebAccess ". substr(sha1(rand()), 0, 7); - $orgEmail = "org". substr(sha1(rand()), 0, 7) . "@web.com"; + $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7); + $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com"; $this->webtestAddOrganization($orgName, $orgEmail); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -537,7 +537,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $pageId = $this->webtestAddContributionPage($hash, $rand, $pageTitle, - null, + NULL, $amountSection, $payLater, $onBehalf, @@ -557,15 +557,15 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $honoreeSection ); - $this->_testOrganization($pageId, $cid, $pageTitle); + $this->_testOrganization($pageId, $cid, $pageTitle); } - function testWithContactSubtypeDupe() { + public function testWithContactSubtypeDupe() { $this->webtestLogin(); //create organisation - $orgName = "Org WebAccess ". substr(sha1(rand()), 0, 7); - $orgEmail = "org". substr(sha1(rand()), 0, 7) . "@web.com"; + $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7); + $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com"; $contactSubType = 'Sponsor'; $this->webtestAddOrganization($orgName, $orgEmail, $contactSubType); @@ -598,7 +598,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $pageId = $this->webtestAddContributionPage($hash, $rand, $pageTitle, - null, + NULL, $amountSection, $payLater, $onBehalf, @@ -618,7 +618,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $honoreeSection ); - //Open Live Contribution Page + //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); $this->waitForElementPresent("onbehalf_state_province-3"); @@ -651,7 +651,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testOrganization($pageId, $cid, $pageTitle) { + public function _testOrganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -682,7 +682,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testAnomoyousOganization($pageId, $cid, $pageTitle) { + public function _testAnomoyousOganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -757,7 +757,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testUserWithOneRelationship($pageId, $cid, $pageTitle) { + public function _testUserWithOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); // Create new group @@ -1003,7 +1003,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle) { + public function _testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -1207,7 +1207,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->type('minimum_fee', '50'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); @@ -1368,7 +1368,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->click("xpath=//div[@id='current-relationships']/div/table/tbody//tr/td[2]/a[text()='{$orgName1}']/../../td[9]/span[2][text()='more ']/ul/li[2]/a[text()='Delete']"); // Check confirmation alert. - $this->assertTrue((bool)preg_match("/^Are you sure you want to delete this relationship?/", + $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this relationship?/", $this->getConfirmation() )); $this->chooseOkOnNextConfirmation(); @@ -1378,7 +1378,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { ); } - function testOnBehalfOfOrganizationWithImage() { + public function testOnBehalfOfOrganizationWithImage() { $this->webtestLogin(); $this->openCiviPage("profile/edit", "reset=1&gid=4"); @@ -1479,7 +1479,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { + public function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom'); @@ -1508,8 +1508,8 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); - imagestring($im, 1, 5, 5, "On Behalf-Org Logo", $text_color); - imagepng($im,"/tmp/file.png"); + imagestring($im, 1, 5, 5, "On Behalf-Org Logo", $text_color); + imagepng($im, "/tmp/file.png"); $imagePath = "/tmp/file.png"; $this->webtestAttachFile('onbehalf_image_URL', $imagePath); @@ -1551,4 +1551,3 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//div[@id='crm-contact-thumbnail']/div/a/img")); } } -