Failed Conditions
Push — develop ( af8aa2...7450c3 )
by Reüel
17:39
created

tests/src/DataCreditCardHelperTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
use DateTime;
6
7
/**
8
 * Title: Ogone data default helper class test
9
 * Description:
10
 * Copyright: 2005-2021 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 * @since   1.1.0
16
 */
17
class DataCreditCardHelperTest extends \WP_UnitTestCase {
18
	/**
19
	 * Test helper.
20
	 */
21
	public function test_helper() {
22
		$data = new Data();
23
24
		$helper = new DataCreditCardHelper( $data );
25
26
		$ed = new DateTime();
27
28
		$helper
29
			->set_number( '378282246310005' )
0 ignored issues
show
'378282246310005' of type string is incompatible with the type integer expected by parameter $number of Pronamic\WordPress\Pay\G...ardHelper::set_number(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
			->set_number( /** @scrutinizer ignore-type */ '378282246310005' )
Loading history...
30
			->set_expiration_date( $ed )
31
			->set_security_code( '123' );
32
33
		$this->assertEquals(
34
			array(
35
				'CARDNO' => '378282246310005',
36
				'ED'     => $ed->format( Ingenico::EXPIRATION_DATE_FORMAT ),
37
				'CVC'    => '123',
38
			),
39
			$data->get_fields()
40
		);
41
	}
42
}
43