From b34f306b749f844b7536e4914acc71478719ae79 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 12 Aug 2021 12:06:05 +1200 Subject: [PATCH] Fix one test & remove 2 that covered the error message --- tests/phpunit/api/v3/ContributionTest.php | 4 ++-- tests/phpunit/api/v3/MembershipTest.php | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 717ce48361..4918f332ee 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -1204,10 +1204,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * In the interests of removing financial type / contribution type checks from * legacy format function lets test that the api is doing this for us */ - public function testCreateInvalidFinancialType() { + public function testCreateInvalidFinancialType(): void { $params = $this->_params; $params['financial_type_id'] = 99999; - $this->callAPIFailure($this->entity, 'create', $params, "'99999' is not a valid option for field financial_type_id"); + $this->callAPIFailure($this->entity, 'create', $params); } /** diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index c23f5150d4..9a62fa14ad 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -915,23 +915,6 @@ class api_v3_MembershipTest extends CiviUnitTestCase { ); } - public function testMembershipCreateWithInvalidStatus() { - $params = $this->_params; - $params['status_id'] = 999; - $this->callAPIFailure('membership', 'create', $params, - "'999' is not a valid option for field status_id" - ); - } - - public function testMembershipCreateWithInvalidType() { - $params = $this->_params; - $params['membership_type_id'] = 999; - - $this->callAPIFailure('membership', 'create', $params, - "'999' is not a valid option for field membership_type_id" - ); - } - /** * Check with complete array + custom field * Note that the test is written on purpose without any -- 2.25.1