StatusesTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A states_matrix_provider() 0 5 1
A test_transform() 0 4 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\PayNL;
4
5
use PHPUnit_Framework_TestCase;
6
use Pronamic\WordPress\Pay\Payments\PaymentStatus as Core_Statuses;
7
8
/**
9
 * Title: Pay.nl states constants tests
10
 * Description:
11
 * Copyright: 2005-2021 Pronamic
12
 * Company: Pronamic
13
 *
14
 * @author Remco Tolsma
15
 * @version 2.0.4
16
 * @since   1.0.0
17
 */
18
class StatusesTest extends \PHPUnit_Framework_TestCase {
19
	/**
20
	 * Test transform.
21
	 *
22
	 * @dataProvider states_matrix_provider
23
	 */
24
	public function test_transform( $state, $expected ) {
25
		$status = Statuses::transform( $state );
26
27
		$this->assertEquals( $expected, $status );
28
	}
29
30
	public function states_matrix_provider() {
31
		return array(
32
			array( Statuses::PAID, Core_Statuses::SUCCESS ),
33
			array( Statuses::CANCELLED, Core_Statuses::CANCELLED ),
34
			array( 'not existing status', null ),
35
		);
36
	}
37
}
38