Failed Conditions
Push — master ( ef4611...12f600 )
by Remco
11:54 queued 05:55
created

PaymentMethodsListTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_constructor() 0 12 1
A test_add_payment_method() 0 9 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ogone payment methods list (PMLIST parameter) test
7
 * Description:
8
 * Copyright: 2005-2019 Pronamic
9
 * Company: Pronamic
10
 *
11
 * @author  Remco Tolsma
12
 * @version 2.0.0
13
 * @since   1.1.0
14
 */
15
class PaymentMethodsListTest extends \WP_UnitTestCase {
16
	/**
17
	 * Test constructor.
18
	 */
19
	public function test_constructor() {
20
		$list = new PaymentMethodsList(
21
			array(
22
				Brands::VISA,
23
				Brands::MASTERCARD,
24
				Brands::AMERICAN_EXPRESS,
25
			)
26
		);
27
28
		$string = (string) $list;
29
30
		$this->assertEquals( 'VISA;MasterCard;American Express', $string );
31
	}
32
33
	/**
34
	 * Test add payment method.
35
	 */
36
	public function test_add_payment_method() {
37
		$list = new PaymentMethodsList();
38
		$list->add_payment_method( Brands::VISA );
39
		$list->add_payment_method( Brands::MASTERCARD );
40
		$list->add_payment_method( Brands::AMERICAN_EXPRESS );
41
42
		$string = (string) $list;
43
44
		$this->assertEquals( 'VISA;MasterCard;American Express', $string );
45
	}
46
}
47