Completed
Push — master ( fc65a2...436b18 )
by Olivier
03:18 queued 01:41
created

ErrorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_getters() 0 9 1
A test_should_throw_exception_on_getting_undefined_property() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ICanBoogie;
13
14
/**
15
 * @group unit
16
 */
17
class ErrorTest extends \PHPUnit_Framework_TestCase
18
{
19
	public function test_getters()
20
	{
21
		$format = uniqid();
22
		$args = [ uniqid() => uniqid() ];
23
		$error = new Error($format, $args);
24
25
		$this->assertSame($format, $error->format);
26
		$this->assertSame($args, $error->args);
27
	}
28
29
	/**
30
	 * @expectedException \LogicException
31
	 */
32
	public function test_should_throw_exception_on_getting_undefined_property()
33
	{
34
		$error = new Error("");
35
		$error->{ uniqid() };
36
	}
37
}
38