ExceptionTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_can_throw_unexpected_type_exception() 0 4 1
A it_can_throw_stack_underflow_exception() 0 4 1
A it_can_throw_invalid_argument_exception() 0 4 1
A it_can_throw_stack_overflow_exception() 0 4 1
1
<?php
2
3
namespace Ptypes\Test;
4
5
use Ptypes\Exceptions\UnexpectedType;
6
use Ptypes\Exceptions\InvalidArgument;
7
use Ptypes\Exceptions\StackOverflow;
8
use Ptypes\Exceptions\StackUnderflow;
9
10
class ExceptionTest extends \PHPUnit_Framework_TestCase
11
{
12
	/** @test */
13
	public function it_can_throw_unexpected_type_exception()
14
	{
15
		$this->expectException(UnexpectedType::class);
16
		throw new UnexpectedType();
17
	}
18
	
19
	/** @test */
20
	public function it_can_throw_invalid_argument_exception()
21
	{
22
		$this->expectException(InvalidArgument::class);
23
		throw new InvalidArgument();
24
	}
25
	
26
	/** @test */
27
	public function it_can_throw_stack_overflow_exception()
28
	{
29
		$this->expectException(StackOverflow::class);
30
		throw new StackOverflow();
31
	}
32
	
33
	/** @test */
34
	public function it_can_throw_stack_underflow_exception()
35
	{
36
		$this->expectException(StackUnderflow::class);
37
		throw new StackUnderflow();
38
	}
39
}