Test Failed
Push — develop ( 98e16c...e3bb23 )
by Reüel
02:40
created

tests/StatusesTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Buckaroo;
4
5
use Pronamic\WordPress\Pay\Core\Statuses as CoreStatuses;
6
7
/**
8
 * Title: Buckaroo statuses constants tests
9
 * Description:
10
 * Copyright: 2005-2019 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author Remco Tolsma
14
 * @version 2.0.0
15
 * @link https://www.mollie.nl/support/documentatie/betaaldiensten/ideal/en/
16
 */
17
class StatusesTest extends \WP_UnitTestCase {
0 ignored issues
show
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...
18
	/**
19
	 * Test transform.
20
	 *
21
	 * @dataProvider statusMatrixProvider
22
	 */
23
	public function testTransform( $buckaroo_status, $expected ) {
24
		$status = Statuses::transform( $buckaroo_status );
25
26
		$this->assertEquals( $expected, $status );
27
	}
28
29
	public function statusMatrixProvider() {
30
		return array(
31
			// Success
32
			array( Statuses::PAYMENT_SUCCESS, CoreStatuses::SUCCESS ),
33
			// Failure
34
			array( Statuses::PAYMENT_FAILURE, CoreStatuses::FAILURE ),
35
			array( Statuses::VALIDATION_FAILURE, CoreStatuses::FAILURE ),
36
			array( Statuses::TECHNICAL_ERROR, CoreStatuses::FAILURE ),
37
			array( Statuses::PAYMENT_REJECTED, CoreStatuses::FAILURE ),
38
			// Open
39
			array( Statuses::WAITING_FOR_USER_INPUT, CoreStatuses::OPEN ),
40
			array( Statuses::WAITING_FOR_PROCESSOR, CoreStatuses::OPEN ),
41
			array( Statuses::WAITING_ON_CONSUMER_ACTION, CoreStatuses::OPEN ),
42
			array( Statuses::PAYMENT_ON_HOLD, CoreStatuses::OPEN ),
43
			// Cancelled
44
			array( Statuses::CANCELLED_BY_CONSUMER, CoreStatuses::CANCELLED ),
45
			array( Statuses::CANCELLED_BY_MERCHANT, CoreStatuses::CANCELLED ),
46
			// Other
47
			array( 'not existing status', null ),
48
		);
49
	}
50
}
51