Test Failed
Push — develop ( 6098b1...78195a )
by Reüel
02:46
created

IDealIssuersParserTest::test_values()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 1
dl 0
loc 16
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\MultiSafepay\Connect;
4
5
use WP_UnitTestCase;
0 ignored issues
show
Bug introduced by
The type WP_UnitTestCase was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Pronamic\WordPress\Pay\Gateways\MultiSafepay\Connect\XML\IDealIssuersResponseMessage;
7
8
class IDealIssuersParserTest extends WP_UnitTestCase {
9
	/**
10
	 * Test init
11
	 */
12
	public function test_init() {
13
		$filename = dirname( __FILE__ ) . '/Mock/ideal-issuers-response.xml';
14
15
		$simplexml = simplexml_load_file( $filename );
16
17
		$this->assertInstanceOf( 'SimpleXMLElement', $simplexml );
18
19
		return $simplexml;
20
	}
21
22
	/**
23
	 * Test parser
24
	 *
25
	 * @depends test_init
26
	 */
27
	public function test_parser( $simplexml ) {
28
		$message = IDealIssuersResponseMessage::parse( $simplexml );
29
30
		$this->assertInstanceOf( 'Pronamic\WordPress\Pay\Gateways\MultiSafepay\Connect\XML\IDealIssuersResponseMessage', $message );
31
32
		return $message;
33
	}
34
35
	/**
36
	 * Test values
37
	 *
38
	 * @depends test_parser
39
	 */
40
	public function test_values( $message ) {
41
		$expected = new IDealIssuersResponseMessage();
42
43
		$expected->issuers = array(
0 ignored issues
show
Bug Best Practice introduced by
The property issuers does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
44
			'0031' => 'ABN AMRO',
45
			'0751' => 'SNS Bank',
46
			'0721' => 'ING',
47
			'0021' => 'Rabobank',
48
			'0091' => 'Friesland Bank',
49
			'0761' => 'ASN Bank',
50
			'0771' => 'SNS Regio Bank',
51
			'0511' => 'Triodos Bank',
52
			'0161' => 'Van Lanschot Bankiers',
53
		);
54
55
		$this->assertEquals( $expected, $message );
56
	}
57
}
58