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

ErrorTest::test_getters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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