PaymentMethodsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_transform() 0 4 1
A status_matrix_provider() 0 6 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\EMS\ECommerce;
4
5
use Pronamic\WordPress\Pay\Core\PaymentMethods as Core_PaymentMethods;
6
7
/**
8
 * Title: EMS e-Commerce Gateway payment methods tests
9
 * Description:
10
 * Copyright: 2005-2022 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author Remco Tolsma
14
 * @version 2.0.0
15
 * @since 1.0.0
16
 */
17
class PaymentMethodsTest extends \PHPUnit_Framework_TestCase {
18
	/**
19
	 * Test transform.
20
	 *
21
	 * @dataProvider status_matrix_provider
22
	 */
23
	public function test_transform( $wp_payment_method, $expected ) {
24
		$ems_payment_method = PaymentMethods::transform( $wp_payment_method );
25
26
		$this->assertEquals( $expected, $ems_payment_method );
27
	}
28
29
	public function status_matrix_provider() {
30
		return array(
31
			array( Core_PaymentMethods::IDEAL, PaymentMethods::IDEAL ),
32
			array( Core_PaymentMethods::PAYPAL, PaymentMethods::PAYPAL ),
33
			array( Core_PaymentMethods::SOFORT, PaymentMethods::SOFORT ),
34
			array( 'not existing payment method', null ),
35
		);
36
	}
37
}
38