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

tests/src/DataGeneralHelperTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ogone data default helper class 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 DataGeneralHelperTest extends \WP_UnitTestCase {
16
	/**
17
	 * Test helper
18
	 */
19
	public function test_helper() {
20
		$data = new Data();
21
22
		$helper = new DataGeneralHelper( $data );
23
24
		$pmlist = new PaymentMethodsList(
25
			array(
26
				Brands::VISA,
27
				Brands::MASTERCARD,
28
				Brands::AMERICAN_EXPRESS,
29
			)
30
		);
31
32
		$helper
33
			->set_psp_id( 'test' )
0 ignored issues
show
'test' of type string is incompatible with the type integer expected by parameter $number of Pronamic\WordPress\Pay\G...ralHelper::set_psp_id(). ( Ignorable by Annotation )

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

33
			->set_psp_id( /** @scrutinizer ignore-type */ 'test' )
Loading history...
34
			->set_order_id( '1234' )
35
			->set_order_description( 'order description' )
36
			->set_amount( 1050 )
37
			->set_currency( 'EUR' )
38
			->set_customer_name( 'Mr. Test' )
39
			->set_email( '[email protected]' )
40
			->set_language( 'nl' )
41
			->set_payment_method( PaymentMethods::IDEAL )
42
			->set_payment_methods_list( $pmlist )
43
			->set_brand( Brands::IDEAL );
44
45
		$this->assertEquals(
46
			array(
47
				'PSPID'    => 'test',
48
				'ORDERID'  => '1234',
49
				'COM'      => 'order description',
50
				'AMOUNT'   => 1050,
51
				'CURRENCY' => 'EUR',
52
				'CN'       => 'Mr. Test',
53
				'EMAIL'    => '[email protected]',
54
				'LANGUAGE' => 'nl',
55
				'PM'       => PaymentMethods::IDEAL,
56
				'PMLIST'   => (string) $pmlist,
57
				'BRAND'    => Brands::IDEAL,
58
			),
59
			$data->get_fields()
60
		);
61
	}
62
}
63