From: Saurabh Batra Date: Wed, 3 Aug 2016 08:25:51 +0000 (+0530) Subject: more tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=46c3679ed4fabbb9a61db8a5d64300f17045f89a;p=civicrm-core.git more tests --- diff --git a/tests/phpunit/api/v3/ValidateTest.php b/tests/phpunit/api/v3/ValidateTest.php index 62db6f9b41..881c9c5a1e 100644 --- a/tests/phpunit/api/v3/ValidateTest.php +++ b/tests/phpunit/api/v3/ValidateTest.php @@ -66,4 +66,24 @@ class api_v3_ValidateTest extends CiviUnitTestCase { $this->assertEquals($validation['values'][0]['contact_id'], $contactIdErrors); } + public function testContributionDateValidate() { + $params = array( + 'action' => "create", + 'financial_type_id' => "1", + 'total_amount' => "100", + 'contact_id' => "1", + 'receive_date' => 'abc', + ); + $validation = $this->callAPISuccess('Contribution', 'validate', $params); + + $expectedOut = array( + 'receive_date' => array( + 'message' => "receive_date is not a valid date: abc", + 'code' => "incorrect_value", + ), + ); + + $this->assertEquals($validation['values'][0], $expectedOut); + } + }