This repository was archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorMapTest.php
More file actions
65 lines (49 loc) · 1.41 KB
/
Copy pathErrorMapTest.php
File metadata and controls
65 lines (49 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
use arabcoders\errors\ErrorMap;
class ErrorMapTest extends \PHPUnit\Framework\TestCase
{
/**
* @var ErrorMap
*/
private static $instance;
public function setUp()
{
self::$instance = new ErrorMap( E_ERROR, 'test', __FILE__, 1 );
}
public function testConstructorTypeAsString()
{
$this->expectException( TypeError::class );
new ErrorMap( 'string', 'message', __FILE__, __LINE__ );
}
public function testConstructorMessageAsArray()
{
$this->expectException( TypeError::class );
new ErrorMap( E_WARNING, [], __FILE__, __LINE__ );
}
public function testConstructorFileAsArray()
{
$this->expectException( TypeError::class );
new ErrorMap( E_WARNING, 'test', [], __LINE__ );
}
public function testConstructorLineAsArray()
{
$this->expectException( TypeError::class );
new ErrorMap( E_WARNING, 'test', __FILE__, [] );
}
public function testGetNumber()
{
$this->assertEquals( E_ERROR, self::$instance->getNumber() );
}
public function testGetMessage()
{
$this->assertEquals( 'test', self::$instance->getMessage() );
}
public function testGetFile()
{
$this->assertEquals( __FILE__, self::$instance->getFile() );
}
public function testGetLine()
{
$this->assertEquals( 1, self::$instance->getLine() );
}
}