|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Credit card test |
|
4
|
|
|
* |
|
5
|
|
|
* @author Pronamic <[email protected]> |
|
6
|
|
|
* @copyright 2005-2018 Pronamic |
|
7
|
|
|
* @license GPL-3.0-or-later |
|
8
|
|
|
* @package Pronamic\WordPress\Pay\Payments |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Pronamic\WordPress\Pay; |
|
12
|
|
|
|
|
13
|
|
|
use WP_UnitTestCase; |
|
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Payment test |
|
17
|
|
|
* |
|
18
|
|
|
* @author Remco Tolsma |
|
19
|
|
|
* @version 1.0 |
|
20
|
|
|
*/ |
|
21
|
|
|
class CreditCardTest extends WP_UnitTestCase { |
|
22
|
|
|
/** |
|
23
|
|
|
* Test construct payment object. |
|
24
|
|
|
*/ |
|
25
|
|
|
public function test_construct() { |
|
26
|
|
|
$credit_card = new CreditCard(); |
|
27
|
|
|
|
|
28
|
|
|
$this->assertInstanceOf( __NAMESPACE__ . '\CreditCard', $credit_card ); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Test setting and getting the credit card number. |
|
33
|
|
|
*/ |
|
34
|
|
|
public function test_set_and_get_number() { |
|
35
|
|
|
$credit_card = new CreditCard(); |
|
36
|
|
|
|
|
37
|
|
|
$number = '5300000000000006'; |
|
38
|
|
|
|
|
39
|
|
|
$credit_card->set_number( $number ); |
|
40
|
|
|
|
|
41
|
|
|
$this->assertEquals( $number, $credit_card->get_number() ); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Test setting and getting the credit card expiration month. |
|
46
|
|
|
*/ |
|
47
|
|
|
public function test_set_and_get_expiration_month() { |
|
48
|
|
|
$credit_card = new CreditCard(); |
|
49
|
|
|
|
|
50
|
|
|
$month = 12; |
|
51
|
|
|
|
|
52
|
|
|
$credit_card->set_expiration_month( $month ); |
|
53
|
|
|
|
|
54
|
|
|
$this->assertEquals( $month, $credit_card->get_expiration_month() ); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Test setting and getting the credit card expiration year. |
|
59
|
|
|
*/ |
|
60
|
|
|
public function test_set_and_get_expiration_year() { |
|
61
|
|
|
$credit_card = new CreditCard(); |
|
62
|
|
|
|
|
63
|
|
|
$year = date( 'Y' ) + 5; |
|
64
|
|
|
|
|
65
|
|
|
$credit_card->set_expiration_year( $year ); |
|
66
|
|
|
|
|
67
|
|
|
$this->assertEquals( $year, $credit_card->get_expiration_year() ); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Test setting and getting the credit card security code. |
|
72
|
|
|
*/ |
|
73
|
|
|
public function test_set_and_get_security_code() { |
|
74
|
|
|
$credit_card = new CreditCard(); |
|
75
|
|
|
|
|
76
|
|
|
$code = '123'; |
|
77
|
|
|
|
|
78
|
|
|
$credit_card->set_security_code( $code ); |
|
|
|
|
|
|
79
|
|
|
|
|
80
|
|
|
$this->assertEquals( $code, $credit_card->get_security_code() ); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* Test setting and getting the credit card name. |
|
85
|
|
|
*/ |
|
86
|
|
|
public function test_set_and_get_name() { |
|
87
|
|
|
$credit_card = new CreditCard(); |
|
88
|
|
|
|
|
89
|
|
|
$name = 'Pronamic'; |
|
90
|
|
|
|
|
91
|
|
|
$credit_card->set_name( $name ); |
|
92
|
|
|
|
|
93
|
|
|
$this->assertEquals( $name, $credit_card->get_name() ); |
|
94
|
|
|
} |
|
95
|
|
|
} |
|
96
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths