MissingTypeExceptionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructorWithOnlyRequiredArguments() 0 6 1
A testConstructorWithAllArguments() 0 7 1
1
<?php
2
3
namespace Deserializers\Tests\Phpunit\Exceptions;
4
5
use Deserializers\Exceptions\MissingTypeException;
6
use Exception;
7
8
/**
9
 * @covers Deserializers\Exceptions\MissingTypeException
10
 *
11
 * @license GPL-2.0-or-later
12
 * @author Jeroen De Dauw < [email protected] >
13
 * @author Thiemo Kreuz
14
 */
15
class MissingTypeExceptionTest extends \PHPUnit\Framework\TestCase {
16
17
	public function testConstructorWithOnlyRequiredArguments() {
18
		$exception = new MissingTypeException();
19
20
		$this->assertSame( '', $exception->getMessage() );
21
		$this->assertNull( $exception->getPrevious() );
22
	}
23
24
	public function testConstructorWithAllArguments() {
25
		$previous = new Exception( 'previous' );
26
		$exception = new MissingTypeException( 'customMessage', $previous );
27
28
		$this->assertSame( 'customMessage', $exception->getMessage() );
29
		$this->assertSame( $previous, $exception->getPrevious() );
30
	}
31
32
}
33