1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Brand ID Test |
4
|
|
|
* |
5
|
|
|
* @author Pronamic <[email protected]> |
6
|
|
|
* @copyright 2005-2022 Pronamic |
7
|
|
|
* @license GPL-3.0-or-later |
8
|
|
|
* @package Pronamic\WordPress\Pay\Gateways\Payvision |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\Payvision; |
12
|
|
|
|
13
|
|
|
use Pronamic\WordPress\Pay\Core\PaymentMethods; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Brand ID Test |
17
|
|
|
* |
18
|
|
|
* @author Remco Tolsma |
19
|
|
|
* @version 1.1.0 |
20
|
|
|
* @since 1.0.0 |
21
|
|
|
*/ |
22
|
|
|
class BrandIdTest extends \WP_UnitTestCase { |
23
|
|
|
/** |
24
|
|
|
* Test. |
25
|
|
|
*/ |
26
|
|
|
public function test() { |
27
|
|
|
$this->assertEquals( '1010', BrandId::VISA ); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Test from core. |
32
|
|
|
* |
33
|
|
|
* @param string $method Method. |
34
|
|
|
* @param string $expected Expected value. |
35
|
|
|
* @dataProvider provider_test_from_core |
36
|
|
|
*/ |
37
|
|
|
public function test_from_core( $method, $expected ) { |
38
|
|
|
$brand_id = BrandId::from_core( $method ); |
39
|
|
|
|
40
|
|
|
$this->assertEquals( $expected, $brand_id ); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Status data provider. |
45
|
|
|
* |
46
|
|
|
* @return array<string, string|null> |
47
|
|
|
*/ |
48
|
|
|
public function provider_test_from_core() { |
49
|
|
|
return array( |
|
|
|
|
50
|
|
|
array( PaymentMethods::AFTERPAY_NL, BrandId::AFTERPAY ), |
51
|
|
|
array( PaymentMethods::BANCONTACT, BrandId::BCMC ), |
52
|
|
|
array( PaymentMethods::IDEAL, BrandId::IDEAL ), |
53
|
|
|
array( PaymentMethods::PAYPAL, BrandId::PAYPAL ), |
54
|
|
|
array( PaymentMethods::MAESTRO, BrandId::MAESTRO ), |
55
|
|
|
array( 'unknown method', null ), |
56
|
|
|
); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|