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

ErrorTest::test_invalid_error()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
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