From 81c55926ba12e80e3ad849d4dbbd78f0c973c736 Mon Sep 17 00:00:00 2001 From: Rob Thorne Date: Wed, 29 Apr 2015 22:06:28 +0000 Subject: [PATCH] CRM-16367 (Payment): added a payment token test for recurring contributions. --- tests/phpunit/api/v3/ContributionRecurTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/phpunit/api/v3/ContributionRecurTest.php b/tests/phpunit/api/v3/ContributionRecurTest.php index aa7ab99520..0d876d4d53 100644 --- a/tests/phpunit/api/v3/ContributionRecurTest.php +++ b/tests/phpunit/api/v3/ContributionRecurTest.php @@ -74,6 +74,19 @@ class api_v3_ContributionRecurTest extends CiviUnitTestCase { $this->assertEquals(1, $result['count']); } + public function testCreateContributionRecurWithToken() { + // create token + $this->createLoggedInUser(); + $paymentProcessor = $this->processorCreate(); + $token = $this->callAPISuccess('PaymentToken', 'create', array('payment_processor_id' => $paymentProcessor->id, 'token' => 'hhh', + 'contact_id' => $this->individualCreate())); + $params['payment_token_id'] = $token['id']; + $result = $this->callAPISuccess($this->_entity, 'create', $this->params); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); + $this->getAndCheck($this->params, $result['id'], $this->_entity); + } + public function testDeleteContributionRecur() { $result = $this->callAPISuccess($this->_entity, 'create', $this->params); $deleteParams = array('id' => $result['id']); -- 2.25.1