From 46c3679ed4fabbb9a61db8a5d64300f17045f89a Mon Sep 17 00:00:00 2001 From: Saurabh Batra Date: Wed, 3 Aug 2016 13:55:51 +0530 Subject: [PATCH] more tests --- tests/phpunit/api/v3/ValidateTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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); + } + } -- 2.25.1