Failed Conditions
Push — develop ( e4f983...8cba91 )
by Remco
04:22
created

ErrorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_error() 0 4 1
A test_invalid_error() 0 4 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\TargetPay;
4
5
/**
6
 * Title: TargetPay error test
7
 * Description:
8
 * Copyright: 2005-2021 Pronamic
9
 * Company: Pronamic
10
 *
11
 * @author  Remco Tolsma
12
 * @version 2.0.0
13
 * @since   2.0.0
14
 */
15
class ErrorTest extends \PHPUnit_Framework_TestCase {
16
	/**
17
	 * Test error.
18
	 */
19
	public function test_error() {
20
		$error = new Error( 'TP0001 No layoutcode specified' );
21
22
		$this->assertEquals( 'TP0001', $error->get_code() );
23
	}
24
25
	/**
26
	 * Test invalid error.
27
	 */
28
	public function test_invalid_error() {
29
		$error = new Error( '' );
30
31
		$this->assertNull( $error->get_code() );
32
	}
33
}
34