X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FContribute%2FBAO%2FContributionPageTest.php;h=56fa1c838382fbdb1072e336a0fa7ea22b1c1af6;hb=f299f7db79fed6f3598c84302966bda087e7cac3;hp=3b6244b6de38005b2c4e2bcf89732c7b9350866b;hpb=35300ebd3b90fd1d73409c4d1b75ffc86a05c728;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php index 3b6244b6de..56fa1c8383 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2019 | + | Copyright CiviCRM LLC (c) 2004-2020 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -44,7 +44,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { */ public function testCreate() { - $params = array( + $params = [ 'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e', 'title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, @@ -61,13 +61,13 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { 'end_date' => '19700101000000', 'end_date_time' => '', 'is_credit_card_only' => '', - ); + ]; $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params); $this->assertNotNull($contributionpage->id); $this->assertType('int', $contributionpage->id); - $this->callAPISuccess('ContributionPage', 'delete', array('id' => $contributionpage->id)); + $this->callAPISuccess('ContributionPage', 'delete', ['id' => $contributionpage->id]); } /** @@ -75,18 +75,18 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { */ public function testsetIsActive() { - $params = array( + $params = [ 'title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, 'is_active' => 1, - ); + ]; $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params); $id = $contributionpage->id; $is_active = 1; $pageActive = CRM_Contribute_BAO_ContributionPage::setIsActive($id, $is_active); $this->assertEquals($pageActive, TRUE, 'Verify financial types record deletion.'); - $this->callAPISuccess('ContributionPage', 'delete', array('id' => $contributionpage->id)); + $this->callAPISuccess('ContributionPage', 'delete', ['id' => $contributionpage->id]); } /** @@ -94,29 +94,29 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { */ public function testSetValues() { - $params = array( + $params = [ 'title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, 'is_active' => 1, - ); + ]; $contributionPage = CRM_Contribute_BAO_ContributionPage::create($params); $id = $contributionPage->id; - $values = array(); + $values = []; CRM_Contribute_BAO_ContributionPage::setValues($id, $values); $this->assertEquals($params['title'], $values['title'], 'Verify contribution title.'); $this->assertEquals($this->_financialTypeID, $values['financial_type_id'], 'Verify financial types id.'); $this->assertEquals(1, $values['is_active'], 'Verify contribution is_active value.'); - $this->callAPISuccess('ContributionPage', 'delete', array('id' => $contributionPage->id)); + $this->callAPISuccess('ContributionPage', 'delete', ['id' => $contributionPage->id]); } /** * Test copy() method */ public function testcopy() { - $params = array( + $params = [ 'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e', 'title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, @@ -133,14 +133,14 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { 'end_date' => '19700101000000', 'end_date_time' => '', 'is_credit_card_only' => '', - ); + ]; $contributionPage = CRM_Contribute_BAO_ContributionPage::create($params); $copyContributionPage = CRM_Contribute_BAO_ContributionPage::copy($contributionPage->id); $this->assertEquals($copyContributionPage->financial_type_id, $this->_financialTypeID, 'Check for Financial type id.'); $this->assertEquals($copyContributionPage->goal_amount, 400, 'Check for goal amount.'); - $this->callAPISuccess('ContributionPage', 'delete', array('id' => $contributionPage->id)); - $this->callAPISuccess('ContributionPage', 'delete', array('id' => $copyContributionPage->id)); + $this->callAPISuccess('ContributionPage', 'delete', ['id' => $contributionPage->id]); + $this->callAPISuccess('ContributionPage', 'delete', ['id' => $copyContributionPage->id]); } }