PaymentMethodsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_transform() 0 4 1
A test_provider() 0 10 1
1
<?php
2
/**
3
 * Test Payment Methods.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2021 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\ING\KassaCompleet
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\ING\KassaCompleet;
12
13
use Pronamic\WordPress\Pay\Core\PaymentMethods as Core_PaymentMethods;
14
15
/**
16
 * Title: ING Kassa Compleet payment methods helper test
17
 * Description:
18
 * Copyright: 2005-2021 Pronamic
19
 * Company: Pronamic
20
 *
21
 * @author  Remco Tolsma
22
 * @version 2.0.0
23
 * @since   1.0.5
24
 */
25
class PaymentMethodsTest extends \PHPUnit_Framework_TestCase {
26
	/**
27
	 * Test transform.
28
	 *
29
	 * @dataProvider test_provider
30
	 *
31
	 * @param string $payment_method Payment method.
32
	 * @param string $expected       Expected value.
33
	 */
34
	public function test_transform( $payment_method, $expected ) {
35
		$ing_method = PaymentMethods::transform( $payment_method );
36
37
		$this->assertEquals( $expected, $ing_method );
38
	}
39
40
	/**
41
	 * Test provider.
42
	 *
43
	 * @return array
44
	 */
45
	public function test_provider() {
46
		return array(
47
			array( Core_PaymentMethods::BANCONTACT, PaymentMethods::BANCONTACT ),
48
			array( Core_PaymentMethods::BANK_TRANSFER, PaymentMethods::BANK_TRANSFER ),
49
			array( Core_PaymentMethods::CREDIT_CARD, PaymentMethods::CREDIT_CARD ),
50
			array( Core_PaymentMethods::IDEAL, PaymentMethods::IDEAL ),
51
			array( Core_PaymentMethods::PAYCONIQ, PaymentMethods::PAYCONIQ ),
52
			array( Core_PaymentMethods::PAYPAL, PaymentMethods::PAYPAL ),
53
			array( Core_PaymentMethods::SOFORT, PaymentMethods::SOFORT ),
54
			array( 'not existing payment method', null ),
55
		);
56
	}
57
}
58