+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
require_once 'CiviTest/CiviUnitTestCase.php';
protected $_apiversion = 3;
protected $_params;
- function setUp() {
+ public function setUp() {
parent::setUp();
$this->useTransaction(TRUE);
// Create dummy processor
///////////////// civicrm_payment_processor_add methods
/**
- * Check with no name
+ * Check with no name.
*/
- function testPaymentProcessorCreateWithoutName() {
+ public function testPaymentProcessorCreateWithoutName() {
$payProcParams = array(
'is_active' => 1,
);
}
/**
- * Create payment processor
+ * Create payment processor.
*/
- function testPaymentProcessorCreate() {
+ public function testPaymentProcessorCreate() {
$params = $this->_params;
$result = $this->callAPIAndDocument('payment_processor', 'create', $params, __FUNCTION__, __FILE__);
- $this->assertNotNull($result['id'], 'in line ' . __LINE__);
+ $this->assertNotNull($result['id']);
//assertDBState compares expected values in $result to actual values in the DB
$this->assertDBState('CRM_Financial_DAO_PaymentProcessor', $result['id'], $params);
}
/**
- * Test using example code
+ * Test using example code.
*/
- function testPaymentProcessorCreateExample() {
+ public function testPaymentProcessorCreateExample() {
require_once 'api/v3/examples/PaymentProcessor/Create.php';
$result = payment_processor_create_example();
$expectedResult = payment_processor_create_expectedresult();
///////////////// civicrm_payment_processor_delete methods
/**
- * Check payment processor delete
+ * Check payment processor delete.
*/
- function testPaymentProcessorDelete() {
+ public function testPaymentProcessorDelete() {
$id = $this->testPaymentProcessorCreate();
$params = array(
'id' => $id,
/**
* Check with valid params array.
*/
- function testPaymentProcessorsGet() {
+ public function testPaymentProcessorsGet() {
$params = $this->_params;
$params['user_name'] = 'test@test.com';
$this->callAPISuccess('payment_processor', 'create', $params);
$this->assertEquals(1, $results['count'], ' in line ' . __LINE__);
$this->assertEquals('test@test.com', $results['values'][$results['id']]['user_name'], ' in line ' . __LINE__);
}
-}
+}